What is the difference between a novice PHP drawing imagecreateformjpeg and a imagecreate?
Header ("Content-type:image/gif"); Defining the output as an image type
$im =imagecreatefromjpeg ("bg.jpg"); Loading photos
$textcolor =imagecolorallocate ($im, 56,73,136); Set the font color to blue and the value to RGB color values
$FNT = "C:/windows/fonts/simhei.ttf"; Defining fonts
$text =iconv ("gb2312", "Utf-8", "Dandong Broken Bridge"); Convert Chinese to UTF-8 format
Imagettftext ($im, 30,0,150,120, $textcolor, $fnt, $text); Write TTF text to the diagram
Imagegif ($im); Create a GIF graphic
Imagedestroy ($im); End graph, free memory space
?>
In the example above, I put
$im =imagecreatefromjpeg ("bg.jpg"); Loading photos
Into
$im =imagecreate (200, 100);
There was a mistake. Why? I just want to replace the background image with my own defined box. PHP Graphics
Share to:
------Solution--------------------
One is loaded from the picture, a completely self-painted.
------Solution--------------------
After testing, your code is not syntactically wrong.
Just not setting the background color