Note that there are some explanatory texts on larger screens.

plurals
  1. PODrawing and deleting old drawings
    primarykey
    data
    text
    <p>I'm new in this forum, and my english is not perfect, so i want to excuse if my question isn't writen good.</p> <p>I'm making a painting program with C# and all is perfect expect one problem. When i'm drawing a line, or rectangle or elipse, when the mouseMove event is called the old shapes is drawed too.</p> <p>How to draw a shape with mouseMove event and the old shapes to not been drawed.</p> <p>Here is part of my code for more clarification.</p> <pre><code>//---Variables declared by the Prgrammer---// //'parent' is variable that take the MdiParent //'mouseIsDown' is boolean variable //'startPoint' and 'endPoint' are Point Varables //'pen' is Pen variable that is configured eralier //'graphic' is pictureBox in the same form. private void pbx_MouseDown(object sender, MouseEventArgs e) { if (parent.btnLine.Checked) { mouseIsDown = true; startPoint = new Point(e.X, e.Y); } } private void pbx_MouseMove(object sender, MouseEventArgs e) { if (mouseIsDown == true &amp;&amp; parent.btnLine.Checked) { pen = new Pen(parent.btnPreview.BackColor, 12); endPoint = new Point(e.X, e.Y); graphic.DrawLine(pen, startPoint, endPoint); } } private void pbx_MouseUp(object sender, MouseEventArgs e) { mouseIsDown = false; } </code></pre> <p>Please help me. This is a big problem for me. Thanks.</p> <hr> <p>Please help me, i'm waiting 2 days. When i'm making a new drawing to the graphic object, the old graphic is deleted.</p> <p>I try the graphic.Save() method, but has not give me right result.</p> <p>How to make the drawings to saty when i'm making another graphic?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload