-
-
//header('Content-Type: text/html;charset=utf-8'); - //Image processing
- //1 Set MIME type output type text/html defaults to the web page type and does not need to be written
-
- header('Content-Type:image/png;');
-
- $width = 400;
- $height = 400;
- //2 Create an image area width and height
- $img = imagecreatetruecolor($width,$height);
-
- //Assign color handle to the image, red and green
- $blue = imagecolorallocate($img,0,102,255);
-
- //Fill color resource handle x-axis y-axis color
- imagefill($img,0,0,$blue);
-
- //Continue to create colors
- $while = imagecolorallocate($img,255,255,255);
-
- //Draw a line handle x start y start x end y end color
- imageline($img,60,90,90,60,$while);
-
- //Print image information
- getimagesize($img);
//Draw text handle font size x-axis Y-axis content color
- imagestring($img,5,0,0,'wwwww',$while);
-
- //Load image list() This function is good
- imagecreatefrompng('22.png');
-
- / /The original image is copied from the new sample to the new image
- //New image handle original image handle new image xy original image xy new image length plateau original image length height
- imagecopyresampled($img,$yuan,40,40,0,0,$ _width,$_height,$width,$height);
-
- //Output image
- imagepng($img);
- //Destroy handle
- imagedestroy($img);
- ?>
-
Copy code
|