首頁  >  文章  >  後端開發  >  ppt圖片透明度 php 圖片上新增透明度漸層的效果

ppt圖片透明度 php 圖片上新增透明度漸層的效果

WBOY
WBOY原創
2016-07-29 08:40:172208瀏覽

複製程式碼 程式碼如下:


////$strimgsrc = file_get_contents("http://127.0 .0.1/5307754.jpg");
////$imgsrc = imagecreatefromstring($strimgsrc);
$imgsrc = imagecreatefromjpeg("5307754.jpg"); );
$imgsrch = imagesy($imgsrc);
$width = 30;
$x1 = 2;
$x2 = $imgsrcw - $x1 - 20;
$y1 = $imgsrcw - $x1 - 20;
$y1 = ($imgsrch - $width) - 2;
$y2 = $y1 + $width;
$steps = $x2 - $x1;
for($i = 0; $i {
$alphax = round($i/($steps/127))+60;
if($alphax >= 128)
$alphax = 127;
$alpha = imagecolorallocatealpha($imgsrc, 255, 255, 255, $alphax);
imagefilledrectangle($imgsrc, ($i+$x1), $y1, ($i+$x1+1), $y2 $alpha);
}
header('content-type: image/jpeg');
imagejpeg($imgsrc);
imagedestroy($imgsrc);
?>
imagedestroy($imgsrc);

?>

以上就介紹了ppt圖片透明度 php 圖片上添加透明度漸變的效果,包括了ppt圖片透明度方面的內容,希望對PHP教程有興趣的朋友有所幫助。

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn