Dynamic PHP Images - How to do?

Discussion in 'PHP' started by -Jerry, Sep 10, 2011.

  1. #1
    Hi guys.

    For example; http://mcserverstatus.com/serverstatus.php?id=2399&theme=1
    This updates every couple of minutes i believe, and it updates the text on the image. I was wondering how i would go about making one of these, or if anyone knows how to code them i will be willing to pay.

    Thanks.
     
    -Jerry, Sep 10, 2011 IP
  2. HuggyEssex

    HuggyEssex Member

    Messages:
    297
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    45
    #2
    They are not too hard to create, you need to use the GD image library which comes as standard when downloading PHP.

    First you would need to build that image as a background and load it in with imagecreatefromjpeg('url to image') that's presuming you create a jpeg. Then once that's complete you need to use this function http://php.net/manual/en/function.imagettftext.php to insert the text at certain coordinates. If you visit the link I've given all the parameters for this function are explained.

    Kind regards,
    Glen
     
    HuggyEssex, Sep 11, 2011 IP
  3. -Jerry

    -Jerry Peon

    Messages:
    62
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks a tonne!
     
    -Jerry, Sep 11, 2011 IP