PHP为什么不能创建彩色图片? $img = imagecreatetruecolor(200,200);用这个函数为什么总是创建的是黑色的图片呢而用imagecreate这个却可以呢,但手册里为什么又要推荐使用imagecreatetruecolor() 来创建呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 本函数需要 GD 2.0.1 或更高版本(推荐 2.0.28 及更高版本)。本函数不能用于 GIF 文件格式。 手册上有推荐用这个函数创建彩图么?建议楼主更新你的PHP手册。 imagecreatetruecolor 创建真彩图片imagecreate 创建位图图片两者均创建初始背景为空(黑色)的图片,只不过位图图片会将第一个定义的颜色作为背景为什么又要推荐使用 imagecreatetruecolor() 来创建呢?除gif格式只允许256色调色板外,其他图片格式都是真彩的。这就是原因 好像还是没有说到点子上,imagecreatetruecolor() 能创建彩色图片,那么如何设置背景色呢?我的版本太低了吗? $im = imagecreatetruecolor(100,100);//创建真彩图片$background = imagecolorallocate($im, 255, 0, 0);//设置一个颜色imagefill($im, 0, 0, $background);//充填图片imagegif($im);如果是位图$im = imagecreate(100,100);$background = imagecolorallocate($im, 255, 0, 0);imagegif($im); 说明resource imagecreatetruecolor ( int x_size, int y_size )imagecreatetruecolor() 返回一个图像标识符,代表了一幅大小为 x_size 和 y_size 的黑色图像。 創建的是黑色的圖像創建彩色圖像可以這樣$im = imagecreate(100, 100);$bg = imagecolorallocate($im, 230, 230, 230);imagefilledrectangle($im,0,0,100,100,$bg); 5楼的方法可以,thank you!!!! 画一个方块然后填充PHP code$im = imagecreate(100, 100);$bg = imagecolorallocate($im, 230, 230, 230);imagefilledrectangle($im,0,0,100,100,$ 从网站优化与推广突然转行PHP网站程序设计,请问合适吗? PHP上传文件强制转换文件名 还是frame刷新的问题 flex能不能调用word? 请问如何修改文本数据库指定行内容. 怎么样实现每天自动向MySQL里插入一条记录啊 PHP文件上传问题 向高手请教关于缓存的机制及用法 关于对比两个数据表的问题.急..... 这个错误怎么解决?Trying to get property 'num_rows' of non-object 求php 用正则表达式修改body的onload里的函数 java程序员转PHP开发,大家帮忙推荐一本精品书
本函数不能用于 GIF 文件格式。 手册上有推荐用这个函数创建彩图么?
建议楼主更新你的PHP手册。
imagecreate 创建位图图片两者均创建初始背景为空(黑色)的图片,只不过位图图片会将第一个定义的颜色作为背景为什么又要推荐使用 imagecreatetruecolor() 来创建呢?
除gif格式只允许256色调色板外,其他图片格式都是真彩的。这就是原因
我的版本太低了吗?
$background = imagecolorallocate($im, 255, 0, 0);//设置一个颜色
imagefill($im, 0, 0, $background);//充填图片
imagegif($im);如果是位图
$im = imagecreate(100,100);
$background = imagecolorallocate($im, 255, 0, 0);
imagegif($im);
resource imagecreatetruecolor ( int x_size, int y_size )
imagecreatetruecolor() 返回一个图像标识符,代表了一幅大小为 x_size 和 y_size 的黑色图像。
創建的是黑色的圖像
創建彩色圖像可以這樣$im = imagecreate(100, 100);
$bg = imagecolorallocate($im, 230, 230, 230);
imagefilledrectangle($im,0,0,100,100,$bg);
PHP code
$im = imagecreate(100, 100);
$bg = imagecolorallocate($im, 230, 230, 230);
imagefilledrectangle($im,0,0,100,100,$