PHP5 GD Library generate graphics verification Code (Kanji) _php Tutorial

Source: Internet
Author: User
Tags imagejpeg

1, use the GD library function to generate the picture, and write the specified characters on the picture
Imagecreatetruecolor Create a new true color image
Imagecolorallocate Assigning color (palette) to an image
Imagestring drawing characters
Imageline Drawing Lines
Imagesetpixel hit pixel points
2, output picture
Imagejpeg ($IMG);
PHP implementation process, code comments in detail, here do not do too much explanation
verify.php

  =("GBK", "Utf-8", "All mortal beings Green Castle and Aoyama places of interest open heart will clouds unroll happiness will always accompany you"(!() || !mb_check_encoding (, "Utf-8"("Not a string or not a Utf-8"= Mb_strlen (, "UTF-8"=(= 0;<;++[] = Mb_substr (,, 1, "UTF-8"= ""(= 0;<4;++((0, 10:.=[(0,-11:.=((0,15["Check"] == Imagecreatetruecolor (100, 30= Imagecolorallocate (, 0, 0, 0= Imagecolorallocate (, 255,255,255Imagettftext (, 13,(2, 9), 20, 20,, "Msyh. TTF ",["Check"] =(= 0;<3;++Imageline (, 0,(0, 20),(70,100),(0, 20),= Imagecolorallocate (,(0, 255),(0, 255),(0, 255(= 0;<200;++,(1, 100),(1, 30),("Content-type:image/jpeg"Imagejpeg (?>

< span="">

 
                                                                                                                                        < span="">< span="">< span="">< span="">< span="">(@< span="">[' Check '< span="">< span="">  < span=""> (  < span=""> < span="">["Check< span="">" "Congratulations!" Verify that the code is entered correctly!   "Sorry, the code input error"< span="">< span="">< span="">< span=""> < span=""> ?>

< span="">

http://www.bkjia.com/PHPjc/440246.html www.bkjia.com true http://www.bkjia.com/PHPjc/440246.html techarticle 1, use the GD library function to generate the picture, and write the specified character on the picture Imagecreatetruecolor create a new true color image imagecolorallocate assign a color (palette) to an image images ...

  • Related Article

    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.