Home » » imagealphablending

imagealphablending

Written By 1 on Tuesday, October 2, 2012 | 9:30 AM

bool imagealphablending ( resource $image , bool $blendmode )

Set the blending mode for an image

imagealphablending() allows for two different modes of drawing on truecolor images. In blending mode, the alpha channel component of the color supplied to all drawing function, such as imagesetpixel() determines how much of the underlying color should be


<?php
// Create image
$im imagecreatetruecolor(100100);

// Set alphablending to on
imagealphablending($imtrue);

// Draw a square
imagefilledrectangle($im30307070imagecolorallocate($im25500));

// Output
header('Content-type: image/png');

imagepng($im);
imagedestroy($im);
?>


0 Comment:

Post a Comment