Generating an Image in PHP?
I know it's possible to generate an Image in PHP; However I don't really know how to do it. I found a tutorial explaining it, but I don't want to just have plain text on my Image. I've developed a banner in Photoshop, and I'd like to add some more stylized text on it through a PHP Script.
Here's my banner that I created in Photoshop.
I want to change the number of players. This is going to be generated via MYSQL, however an example of just setting it to a pre-defined variable would be lovely.
IE: $var = 3;
and then setting the number of players to equal $var
Anyway, Help. pls.
imagefttext() allows you to use FreeType 2 fonts.
How would I go about sending Transparency / Alpha to the font?
Originally Posted by ShrineDesigns
Also, What about my glow effects from Photoshop?
you can enable transparency via imagealphablending()
as for applying effects... I don't have much experience applying effects using PHP that you would in a GUI based image editor.
My best suggestion would be to search the web for PHP based image manipulations.
You can use imagecreatefromgif("path/file.gif") to retrieve and return it as an image. If it's an animated gif, then I believe only the first frame will be returned. If it's a custom font you're using or a font not in PHP or the browser, you'll need to load it using imagepsloadfont. To write text, you can either use imagestring, imagepstext or imagegetftext to write text to your image. The difference between these 3 seems to be that imagestring will create a horizontal String but cannot be slanted and you have to position it to be over your image. The latter 2 allow for slant, tightness and other parameters, as well as setting in over the image.
Writing the number of players can be achieved by storing $val into a $_GET, $_POST or $_SESSION and using it in one of the image-String functions.
Here's a list of all the built-in PHP image functions.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)