Ok, this is a programming help...I am working on a paint program. I want to display the size of a brush via an drawn ellipse at the cursor. When i move the cursor, i want the ellipse to follow.
I am currently able to draw the ellipse but cannot find a way to erase the previous drawn ellipse when i move the cursor. I end up with a lot of ellipses all over the canvas.
here's my code:
// Draw Ellipse
brush.style := bsclear;
pen.mode := pmnot;
pen.width := 1;
ellipse(xmouse - temprx, ymouse - tempry, xmouse + temprx, ymouse + tempry);
// This code if added will erase the previously drawn ellipse. I need to find a way to store the previous coordinates before it is called
brush.style := bsclear;
pen.mode := pmnot;
pen.width := 1;
ellipse(xmouse - temprx, ymouse - tempry, xmouse + temprx, ymouse + tempry);
I cannot find a way to store the previous coordinates and erase the previous ellipse before a new one is drawn when i mouve my mouse.
If anybody has the answer to my alogorithm dilemna, i would appreciate it.
Thanks.
PO
I am currently able to draw the ellipse but cannot find a way to erase the previous drawn ellipse when i move the cursor. I end up with a lot of ellipses all over the canvas.
here's my code:
// Draw Ellipse
brush.style := bsclear;
pen.mode := pmnot;
pen.width := 1;
ellipse(xmouse - temprx, ymouse - tempry, xmouse + temprx, ymouse + tempry);
// This code if added will erase the previously drawn ellipse. I need to find a way to store the previous coordinates before it is called
brush.style := bsclear;
pen.mode := pmnot;
pen.width := 1;
ellipse(xmouse - temprx, ymouse - tempry, xmouse + temprx, ymouse + tempry);
I cannot find a way to store the previous coordinates and erase the previous ellipse before a new one is drawn when i mouve my mouse.
If anybody has the answer to my alogorithm dilemna, i would appreciate it.
Thanks.
PO