The Animation program is Rolling Ball over a horizontal line . The ball start rolling at the start of the line and moves till the end of line length.The program is implemented using C++ MS Visual studio , MFC application.
PROGRAM:
PROGRAM:
void CAnimation1View::OnDraw(CDC* pDC)
{
CAnimation1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
POINT ball[2]={25,150,75,100};
pDC->Ellipse(ball[0].x,ball[0].y,ball[1].x,ball[1].y);
for(int i=0;i<600;i++)
{
pDC->FloodFill(50,50,RGB(100,100,100));
pDC->Ellipse(ball[0].x++,ball[0].y,ball[1].x++,ball[1].y);
pDC->MoveTo(10,150);
pDC->LineTo(600,150);
Sleep(1);
}
}
OUTPUT:
2 comments:
this is tupid
tupid!!!!!!!
Post a Comment
If You Are Asking Some Question On This Comment Then Click On Subscribe by email Link