Jump to content

Rotate image string vertical, i.e. top to bottom


D.Rattansingh

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);

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.