Re: Confused about how exactly to output image using imagepng function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Save the image as a file. Then html src="filename"

Dave M G <martin@xxxxxxxxxxxxx> wrote:  PHP list,

I've looked at the manual entries for imagepng() and 
imagecreatetruecolor() functions for helping me to create a temporary 
image for a CAPTCHA system.

However, I'm clearly messing up, as what I'm outputting is a bunch of 
ASCII gibberish to the screen.

What I think I need to do in principle is first create the image with 
imagecreatetruecolor(), then define it as a PNG (?), then display it.

So I've got something like this:

$image = ImageCreate($width, $height);
ImageFill($image, 0, 0, $black);
echo '' . "\n";
ImageDestroy($image);

As mentioned, this isn't working, so there's a fundamental concept about 
how PHP creates and displays images that I'm not getting.

I'm trying to output an image that, ideally, won't be stored as a file. 
Or, if it has to be a temporary file, to delete it immediately after 
displaying it.

What part am I not understanding?

Thank you for any advice or information.

-- 
Dave M G
Ubuntu Feisty 7.04
Kernel 2.6.20-15-386

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux