Jump to content

How Creat A Square Picture With Two Colors


jason213123

Recommended Posts

I never even knew PFMaBiSmAd's method even existed - that's why I didn't think you could do it with php

 

<?php
$im = imagecreate (50,50);
$red = imagecolorallocate($im, 0xFF, 0, 0);
$grn = imagecolorallocate($im, 0, 0xFF, 0);
$blk = imagecolorallocate($im, 0, 0, 0);

$pts = array (0, 0, 0, 49, 49, 0);
imagefilledpolygon($im, $pts, 3, $grn);
imagerectangle($im, 0, 0, 49, 49, $blk);

header("content-type: image/png");
imagepng($im);
imagedestroy($im);
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.