Reply to Re: Displaying dynamically generated PNG

Your name:

Reply:


Posted by Andrew @ Rockface on 07/02/05 13:36

shawn wrote:
> Hi,
>
> I downloaded a piegraph class from phpclasses.org
> (http://www.phpclasses.org/browse/file/9316.html) and was able to show the
> sample pie graph. However if I include it directly in my code all are
> gibberish. I need to use <embed src="myfiles/pie.php"> to display it using
> browser's plug-in. In my case, Quicktime was the one to handle the phg
> format.
>
> The problem is: this works only on machine where Quicktime is already in
> place. If a browser doesn't have a png handler, for example without
> Quicktime, the embed simply displays as an empty image box. I was trying to
> add some parameter to the code like below:
>
> <embed src="pie.php" width="300" height="100" MIME-Type="image/x-png;
> image/png">
>
> but it didn't see to have any impact.
>
> I can't ask visitors to install Quicktime on their machines. All I wanted is
> to be able to show this dynamic generated png image in a php web page. Could
> someone tell me what I have not done right here and what is the proper way
> of doing this?

I think I see what's happening. The class is displaying the png direct -
it sends a header of 'Content-type: image/png'. I think you are trying
to insert it in a page where you've already sent a header.

Try changing one of the last lines in the piegraph class code from:
imagepng($final);
To:
imagepng($final, "test.png");
Then create a regular <img src="test.png">.

--
Andrew @ Rockface
www.rockface-records.co.uk
"Pablo Picasso never got called an asshole"

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация