Here, first talk about the relationship.
Most people use is a one to draw, but that good trouble, the computer is a bit easier to deal with repetitive things, that is defined as a draw square function, each call on it.
How do I customize a function?
We first right-click on the project we built last time, select Add Menber function and then we add the function return value and function description Cdemoview.
As shown in figure:
Click OK, we go to the function definition place, write the function can be
Finish writing me then you can call in the OnDraw.
And then the same way to continue to write the circle of the method is OK
void Cdemoview::D rawcircle (int x, int y, int r,int color)
{
CDC *PDC = GetDC ();//Get Device Environment for
(double sita=0;sit A<314.0;SITA+=1.0/50)
{
int xx =x+r*cos (SITA);
int yy =y+r*sin (SITA);
Pdc->setpixel (Xx,yy,color);
}
Now we can see the effect.
As pictured.