[color= #0000FF] This verification code picture shows the number is too small, how to change the size of the font in the following code, the number becomes larger [/color]
Generate a Captcha picture
Header ("Content-type:image/png");
$rand = "";
for ($i =0; $i <4; $i + +) {
$rand. =dechex (rand (0,15));
}
$im = Imagecreate (100,50); Make picture background size
$black = Imagecolorallocate ($im, 0,0,0); Set of three Colors
$white = Imagecolorallocate ($im, 255,255,255);
$gray = Imagecolorallocate ($im, 200,200,200);
for ($i =0; $i <3; $i + +) {
$te =imagecolorallocate ($im, Rand (0,255), Rand (0,255), Rand (0,255));
}
Imagefill ($im, 0,0, $gray); Using area Fill method, set (0,0)
while (($rand =rand ()%100000) <10000);
Drawing a four-bit integer verification code into a picture
$_session[' rand ']= $rand;
Imagestring ($im, 5, $rand, $te);
Use the col color to draw the string s to the x, y coordinates of the image represented by the image (0, 0 in the upper-left corner).
If the font is 1,2,3,4 or 5, use the built-in font
------to solve the idea----------------------
Imagestring ($im, 5, 1-5, $rand, $te); This function uses the built-in font, which is a range of. can only be replaced by the Imagettftext () function.
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.