用计算机图形学画圆的程序
#i
nclude
#pragma hdrstop
#include 'Unit1.h '
请参见-------------------------------------------------
#pragmapackage(smart_init ) )。
#pragma resource '*.dfm '
TForm1 *Form1;
请参见-------------------------------------------------
_ _ fastcall tform 1:3360 tform1(t component * owner ) )。
3360表单(所有者)
{
}
请参见-------------------------------------------------
void _ _ fastcall tform 1:3360 button1click (tobject * sender ) ) ) ) ) ) ) ) ) ) ) ) 652 )
{
int r,x,y;
float d;
x=0;
y=r;
d=5.0/4-r;
image1-canvas-pixels [ 250 ] [ 175 ]=clblack;
while(yx ) )。
{if(D0 ) )
{d=2.0*x 3;
x; }
else
{d=(x-y ) *2.0 5) 5;
x;
y----; }
image1-canvas-pixels [ 250 x ] [ 175-y ]=clblack;
}
x=r;
y=0;
d=5.0/4-r;
while(y
{if(D0 ) )
{d=2.0*y 3;
y; }
else
{d=(y-x ) *2.0 5) 5;
y;
x----; }
image1-canvas-pixels [ 250 x ] [ 175-y ]=clblack;
}
x=0;
y=r;
d=5.0/4-r;
while(y(-x ) )
{if(D0 ) )
{d=2.0*(-x ) 3;
x----; }
else
{d=(-x-y ) ) *2.0 5;
(x---- );
y----; }
image1-canvas-pixels [ 250 x ] [ 175-y ]=clblack;
}
x=-r;
y=0;
d=5.0/4-r;
while(y
{if(D0 ) )
{d=2.0*y 3;
y; }
else
{d=(yx ) *2.0 5) 5;
y;
x; }
image1-canvas-pixels [ 250 x ] [ 175-y ]=clblack;
}
x=0;
y=-r;
d=5.0/4-r;
wile(-yx ) )。
{if(D0 ) )
{d=2.0*x 3;
x; }
else
{d=(xy ) *2.0 5) 5;
x;
y; }
image1-canvas-pixels [ 250 x ] [ 175-y ]=clblack;
}
x=r;
y=0;
d=5.0/4-r;
while(-y
{if(D0 ) )
{d=2.0*(-y ) 3;
y----; }
else
{d=(-y-x ) ) *2.0 5;
y----;
x----; }
image1-canvas-pixels [ 250 x ] [ 175-y ]=clblack;
}
x=0;
y=-r;
d=5.0/4-r;
while(-y-x ) )。
{if(D0 ) )
{d=2.0*(-x ) 3;
x----; }
else
{d=(-xy ) ) 2.0 ) 5;
x----;
y; }
image1-canvas-pixels [ 250 x ] [ 175-y ]=clblack;
}
x=-r;
y=0;
d=5.0/4-r;
while(-y
{if(D0 ) )
{d=2.0*(-y ) 3;
y----; }
else
{d=(-yx ) *2.0 5) 5;
y----;
x; }
image1-canvas-pixels [ 250 x ] [ 175-y ]=clblack;
}
}
请参见-------------------------------------------------
void _ _ fastcall tform 1:3360 button2click (tobject * sender ) ) ) ) ) ) ) ) ) ) ) ) 652
{
image1-canvas-brush-color=clwhite;
image1-canvas-fillrect (rect (0,0,500,350 );
}
----------------