3-1 Basics of Graphics Drawing

1 <? php
 2  /* *
 3  * graphics drawing
 4  * complex graphics drawing
 5  *
 6   */ 
7  
8  // $im = imagecreatetruecolor(400, 200);
 9  //$back = imagecolorallocate($im, mt_rand(200 , 255), mt_rand(200, 255), mt_rand(200, 255));
 10  
11  //imagefill($im, 0, 0, $back);
 12  
13  //dot
 14  //$black = imagecolorallocate( $im,10,10,10);
 15  //for($i=0;$i<150;$i++)
 16  //{
 17  // imagesetpixel($im,mt_rand(10,390),mt_rand(10,190), $black);
 18  //}
19  
20  //Draw line
 21  //$red = imagecolorallocate($im, 10, 0, 0);
 22  //for($j = 0; $j < 3; $j++)
 23  //{
 24  // imageline ($im, mt_rand(10, 400), mt_rand(10, 200), mt_rand(10, 400), mt_rand(10, 200), $red);
 25  
26  //}
 27  
28  //set line thickness
 29  / /imagesetthickness($im,5);
 30  //imageline($im, mt_rand(10, 400), mt_rand(10, 200), mt_rand(10, 400), mt_rand(10, 200), $red);
 31  
32  //$style = array($red,$red,$red,$red,$red,$back,$back,$back,$back,$back);
 33  
34  //Set the style of the line
 35  / /imagesetstyle($im,$style);
 36 
37  //Set the style of the line
 38  //imageline($im,10,50,250,200,IMG_COLOR_STYLED);
 39  
40  //Draw a rectangle
 41  //imagerectangle($im,50,50,150,150,$red);
 42  
43  //Draw circle
 44  //imageellipse($im,200,100,100,100,$red);
 45  
46  //header('Content-Type:image/jpeg');
 47  //imagejpeg($im, null, 70);

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325113093&siteId=291194637