Re: ImageCreateFromPNG
| From: | Michael J. Pawlowsky | Date: | Fri, 03 Jan 2003 17:23:40 +0000 |
| Subject: | Re: ImageCreateFromPNG | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-130129@lists.php.net to get a copy of this message | ||
Oops... thought you wanted them to upload a file...
So here something else... just modify it to your needs....
It' the code to the URL I sent you...
<?php
header("Content-type: image/gif");
// Define some constants here (I know they are vars)
$imagewidth = 400;
$imageheight = 400;
$img = imagecreate($imagewidth, $imageheight);
// Let's define some colours
$white = ImageColorAllocate($img, 255, 255, 255);
$blue = ImageColorAllocate($img, 0, 0, 255);
$black = ImageColorAllocate($img, 0, 0, 0);
$grey = imagecolorallocate($img, 128,128,128);
$navy = imagecolorallocate($img, 0,0,128);
// Define patterns (Styles)
$dash=array($white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey);
// Define bit map font
$run0 = imageloadfont("/var/sites/rconline.ca/web/wind/run0.gdf");
$run180 = imageloadfont("/var/sites/rconline.ca/web/wind/run180.gdf");
//-------------------------------------------
// Ready to go -- Lets create an image
//-------------------------------------------
// Draw the runway
imagefilledrectangle ($img, 150, 0, 250, 400, $black);
imagefilledrectangle ($img, 154, 4, 246, 396, $grey);
//Add the wind speeds
ImageString($img, 5, 178, 185, Hello", $blue);
Imagegif($img);
// Imagejpeg($img);
ImageDestroy($img);
?>
*********** REPLY SEPARATOR ***********
On 03/01/2003 at 11:58 AM Michael Weiner wrote:
>Does someone have a script of php function or page that has this code
>working that i can review? I am wanting to create a webpage that will
>let a user enter in an image name (i.e. a png or whatever) and have php
>create an image from that...
>
>Thanks in advance
>Michael Weiner
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php