Using imagettftext to input characters in an image cannot generate an image in a browser.-php Tutorial

Source: Internet
Author: User
Images); you can output images, but if you can directly output images to a browser, you cannot. The following code is PHPcode & lt ;? PhpHeader (Content-type: imag uses imagettftext to input characters on the image, and the image cannot be generated in the browser.
I wrote a Chinese character string in imagettftext.pdf on the image, which can be used to output the image in a browser and use imagepng(imim,'x.png '). I can output the image but cannot output it to a browser. My code below
PHP code
  
  


------ Solution --------------------
Discussion

Reference:

Reference:

There is no error message. the browser is blank, but some garbled characters will appear in IE browser. I try to replace imagettftext with imagestring to make the output work normally, provided that I want to remove Chinese characters ......


Imagestring does not support Chinese characters. Only yong imagettftext is supported. if it is garbled, it indicates that the image may be lost before it is generated ......

------ Solution --------------------
Discussion
Text.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.