home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 March
/
VPR9703A.ISO
/
FFILLY
/
Kouza12
/
diamond.tfy
< prev
next >
Wrap
Text File
|
1997-01-03
|
797b
|
31 lines
//diamond.tfy DRAWサンプル2
main(){
int dot,pic,width,height;
int i,j;
int x1,y1,x2,y2;
real rd,r;
width=640;
height=480;
r=200.0;
rd=3.14159/180.0;
dot=LoadPic("1pixel.bmp");
pic=CreatePic(dot,width,height);
SetLineSize(1);
SetPaintColor(0xffffff);
DrawRect(pic,0,0,width,height);
SetPaintColor(0x000000);
DrawRect(pic,10,10,width-10,height-10);
SetPaintColor(0xffffff);
OpenWin(pic);
r=StrtoReal(StrInput("半径は?(50~230)"));
for(i=0;i<=14;i=i+1){
x1=RealtoInt(Cos(InttoReal(i)*22.5*rd)*r)+width/2;
y1=RealtoInt(Sin(InttoReal(i)*22.5*rd)*r)+height/2;
for(j=i+1;j<=15;j=j+1){
x2=RealtoInt(Cos(InttoReal(j)*22.5*rd)*r)+width/2;
y2=RealtoInt(Sin(InttoReal(j)*22.5*rd)*r)+height/2;
DrawLine(pic,x1,y1,x2,y2);
}
}
mes(LBDOWN){}
}