Jump to content

Recommended Posts

I used imageflip to flip the image horizontally and vertically so the text appears to be written from top to bottom.

header('Content-type: image/png');

// create a 100*100 image
$im = imagecreatetruecolor(100, 100);

// Write the text
$textcolor = imagecolorallocate($im, 0xFF, 0x00, 0xFF);
imagestringup($im, 3, 40, 80, 'gd library', $textcolor); // write text bottom to top

/* Flip the image, so text is top to bottom */
imageflip($im, IMG_FLIP_HORIZONTAL);
imageflip($im, IMG_FLIP_VERTICAL);

echo imagepng($im);
imagedestroy($im);
Edited by Ch0cu3r
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.