PHP 8.5.0 Beta 1 available for testing

Voting

: min(nine, eight)?
(Example: nine)

The Note You're Voting On

codam
14 years ago
Creating a transparent image filled with tranparent color only

I had some hard times putting up this one:

<?php
// Set the image
$img = imagecreatetruecolor(100,100);
imagesavealpha($img, true);

// Fill the image with transparent color
$color = imagecolorallocatealpha($img,0x00,0x00,0x00,127);
imagefill($img, 0, 0, $color);

// Save the image to file.png
imagepng($img, "file.png");

// Destroy image
imagedestroy($img);
?>

<< Back to user notes page

To Top