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

  1. //line.tfy DRAWサンプル5
  2. main(){
  3.     int dot,pic,width,height;
  4.     int x1,y1,x2,y2,col,color[];
  5.     color[0]=0x000000;
  6.     color[1]=0xff0000;
  7.     color[2]=0x0000ff;
  8.     color[3]=0xff00ff;
  9.     color[4]=0x00ff00;
  10.     color[5]=0xffff00;
  11.     color[6]=0x00ffff;
  12.     color[7]=0xffffff;
  13.     width=640;
  14.     height=480;
  15.     dot=LoadPic("1pixel.bmp");
  16.     pic=CreatePic(dot,width,height);
  17.     SetLineSize(1);
  18.     SetPaintColor(0xffffff);
  19.     DrawRect(pic,0,0,width,height);
  20.     SetPaintColor(0x000000);
  21.     DrawRect(pic,10,10,width-10,height-10);
  22.     SetPaintColor(0xffffff);
  23.     OpenWin(pic);
  24.     x1=Random(640);
  25.     y1=Random(480);
  26.     mes(TIME){
  27.         x2=Random(640);
  28.         y2=Random(480);
  29.         col=Random(7)+1;
  30.         SetPaintColor(color[col]);
  31.         DrawLine(pic,x1,y1,x2,y2);
  32.         x1=x2;
  33.         y1=y2;
  34.     }
  35.     mes(LBDOWN){}
  36. }