home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / FFILLY / Kouza12 / flower.tfy < prev    next >
Text File  |  1997-01-03  |  748b  |  29 lines

  1. //flower.tfy DRAWサンプル2
  2. main(){
  3.     int dot,pic,width,height;
  4.     int i;
  5.     int x1,y1,x2,y2;
  6.     real rd,r;
  7.     width=640;
  8.     height=480;
  9.     r=200.0;
  10.     rd=3.14159/180.0;
  11.     dot=LoadPic("1pixel.bmp");
  12.     pic=CreatePic(dot,width,height);
  13.     SetLineSize(1);
  14.     SetPaintColor(0xffffff);
  15.     DrawRect(pic,0,0,width,height);
  16.     SetPaintColor(0x000000);
  17.     DrawRect(pic,10,10,width-10,height-10);
  18.     SetPaintColor(0xffffff);
  19.     OpenWin(pic);
  20.     r=StrtoReal(StrInput("半径は?(50~230)"));
  21.     for(i=0;i<=360;i=i+5){
  22.         x1=RealtoInt(Cos(InttoReal(i)*rd)*r)+width/2;
  23.         y1=RealtoInt(Sin(InttoReal(i)*rd)*r)+height/2;
  24.         x2=RealtoInt(Cos(InttoReal(i+120)*rd)*r)+width/2;
  25.         y2=RealtoInt(Sin(InttoReal(i+120)*rd)*r)+height/2;
  26.         DrawLine(pic,x1,y1,x2,y2);
  27.     }
  28.     mes(LBDOWN){}
  29. }