Jump to content

Add height to image?


Joshua F

Recommended Posts

I have a code that will get the value of amount from $_GET, and it adds it to an image I have stored. My problem is the that image I use is 32x32, but I need to add more height to it to make it look correct. The image is transparent so I'd need to keep that also. The code I have now works, but the value of amount is on top of the image where I don't want it to be. Here's my code.

 

<?php
header("Content-type: image/png");

$image = $_GET['image'] .'.png';

$img_handler = imageCreateFromPNG("./item images/" . $image);
imagesavealpha($img_handler, true);
$color = ImageColorAllocate($img_handler, 204, 156, 12);
ImageString($img_handler, 2, 0, 0, $_GET['amount'], $color);
ImagePng($img_handler);
ImageDestroy($img_handler);
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.