欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

動(dòng)態(tài)生成gif格式的圖像要注意?

 更新時(shí)間:2006年10月09日 00:00:00   作者:  
如果你用
int imagecreatefromgif(string filename);  
來(lái)取出一張 GIF 格式圖形,當(dāng)背景或者基本的畫(huà)布樣本使用,在其上繪制圖形,請(qǐng)注意:
如果這個(gè)文件中沒(méi)有的色素,你將不能使用。


解決方法,你可以用
int imagecreate(int x_size, int y_size);
建立一張全空的圖形。在其上繪制圖形。將黑色作為透明色。
這個(gè)新建的圖形要和原圖形大小相同,絕對(duì)位置相同,將其放在原圖形上方,就可以了。

<img border="0" src="1.gif" style="position: absolute; left: 1; top: 1; z-index: 0" width="200" height="300">
原圖形文件

<img border="0" src="photo.php" style="position: absolute; left: 1; top: 1; z-index: 1" width="200" height="300">
全空文件 photo.php

photo.php 的代碼:
<?php
Header("Content-type: image/gif");
$im = imagecreate(200,300);
$black = ImageColorAllocate($im, 0,0,0);
$red = ImageColorAllocate($im, 255,0,0);
$blue = ImageColorAllocate($im, 0,0,255);

imagerectangle($im,100,200,150,200,$red) ;
imagestring($im,2,120,150,"aaaaaaaa",$blue);

imagecolortransparent($im,$black);
//將黑色作為透明色

ImageGif($im);
ImageDestroy($im);

?>  

【本文版權(quán)歸作者與奧索網(wǎng)共同擁有,如需轉(zhuǎn)載,請(qǐng)注明作者及出處】    

相關(guān)文章

最新評(píng)論