PHP - ImageCreate()

Status
Not open for further replies.

Xrproto

Waste of e-space
Aug 1, 2006
1,869
13
0
I need some help on a few things.

What I'm trying to do is capture a html page and output it into a image file (PNG)

Now I know how to use ImageCreate() and ad text strings to it but I'm not sure where to begin to output a html page into an image.
 


This isn't something easy to do. I tried (using Linux) but never found something that did it well - so I ended up buying a 2nd PC and using MacroScheduler to automate the process.

While my script is done using IE, I'm thinking about redoing it and using Pearl Crescent Page Saver - it's a nice tool and becoming easier and easier to automate with.

In a nutshell, the php imagecreate() function is NOT what you need.

If you only need a few, check out thumbshots.org, or if you're willing to pay, thumbshots.com.
 
  • Like
Reactions: Xrproto
Ah crap...didn't think it was and the further I did it would just be easier to parse it all over again when I create an image.

What I have is a page that scraps stats off of a site, I parse it and out put it to an html page where I have it sorted nicely in front of an image.

What I want to do is output the text to the image also so it just comes up as a png file on the page.

It would be easier for me to just write the code usning imagestring() to place the data on the png file where I want it before I output it.

Thanks for the help
 
Sorry for repeating what you said, but I want to make sure I have it right:

You have a PNG and some data. You want to put the data on the PNG. Something like those weather "stickers" you can get from weather.com, or maybe stock information. You want to put the text on the image, so you can call the image from any other website, and show the finished product (like http://mysite.com/ticker.png?q=GOOG or http://www.mysite.com/weather.png?z=14217)

If I understand you correctly, see:
imagecreatefrompng()
imagecolorallocate() // To set the color of your text
imagettfbbox()

If you need some code, PM me.

Eric
 
Yup got it. Already set it up calling those functions, I just didn't want to write it out when I had all the data already going to a html page.

Thanks again
 
Status
Not open for further replies.