php生成背景颜色图片验证码
imagecreatetruecolor()创建一个真彩色图像后,
并不会自动把imagecolorallocate()方法注册的第一个颜色作为背景色,而必须用imagefill()去填充
//设置颜色
$bg = imagecolorallocate($im, 240, 240, 0);//设置背景颜色
imagefill($im,0,0,$bg);//载入背景颜色
$te = imagecolorallocate($im, 0, 0, 0);//字符串颜色
//将字符串加到图片上
imagestring($im,rand(3,6),rand(5,60),rand(5,15),$rand,$te);
//输出图片
header("Content-type: image/jpeg");
imagejpeg($im);imagecreatetruecolor()返回一个图像标识符代表指定大小的黑色形象。
根据你的PHP和GD版本中函数定义与否。对于PHP 4.0.6通过4.1.x这个函数总是存在的
更多详细内容请查看:php教程er/24/php-imagecreatetruecolor.htm">http://www.bKjia.c0m/phper/24/php-imagecreatetruecolor.htm

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Chinese version
Chinese version, very easy to use

Dreamweaver Mac version
Visual web development tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft