Image generator
I'd like to be able to generate an image with overlaying text (that is inputted by the user) such as how it is done on www.depressiondog.info. Can someone show/link me to some code that will do that. Thanks开发者_开发百科.
The Depression Dog site sends a request to a PHP page on an Apache server. They probably use some code like you'll find in this tutorial explaining how watermark PNG and JPEG Images with PHP and GD2.
- Here's the request to their service :
http://www.vumf.com/ddog.jpg?l1=PHP&l2=Makes+Me+Cry&l1f=26&l2f=26&f=2
- And Here is the Image
- PHP Makes Me Cry http://www.vumf.com/ddog.jpg?l1=PHP&l2=Makes+Me+Cry&l1f=26&l2f=26&f=2
Like the comments say, it depends on your server side language. However, the website you have provided uses PHP on the server side.
This probably involves the GD library, in particular the imagettftext function.
A nice tutorial can be found here.
I've had some pretty good experiences with imagemagick in the past.
精彩评论