ok im trying to create a animation of circle i have a while loop that loops and set var value the varable will be used to set the circle x value
here is the loop
well i can sucessfully draw the cirlce but not repaint it what happens is this it creates a circle with x value 1 than it creates another circle with value 3 it shouldn't it should delete the circle with value 2 than create new one with value 3
here is the draw circle code
i posted this question in 2 different place still no answer would help me. i would really appreciation your help
here is the loop
Code:
while(sd==1)
{
sf++;//globe var, sf equals 1
onPaint(hdc);//paint the circle
InvalidateRect (hWnd, NULL, TRUE);//it should repaint the window but it doesn't
UpdateWindow(hWnd);
}
here is the draw circle code
Code:
VOID onPaint(HDC hdc)
{
Graphics graphics(hdc);
Pen pen(Color(255, 0, 0, 255));
graphics.DrawEllipse(&pen, sf , 0, 10, 10);
}
Comment