D.Rattansingh Posted December 23, 2013 Share Posted December 23, 2013 Using the imagestring up function, the text rotates from bottom to top. Is there any way to rotate the text from the other angle? i.e. top to bottom? Link to comment https://forums.phpfreaks.com/topic/284908-rotate-image-string-vertical-ie-top-to-bottom/ Share on other sites More sharing options...
Ch0cu3r Posted December 23, 2013 Share Posted December 23, 2013 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); Link to comment https://forums.phpfreaks.com/topic/284908-rotate-image-string-vertical-ie-top-to-bottom/#findComment-1462996 Share on other sites More sharing options...
Barand Posted December 23, 2013 Share Posted December 23, 2013 image_rotate($im,180); would have the same effect. If you use imagettftext() you can specify any angle for the text. Link to comment https://forums.phpfreaks.com/topic/284908-rotate-image-string-vertical-ie-top-to-bottom/#findComment-1462998 Share on other sites More sharing options...
D.Rattansingh Posted December 23, 2013 Author Share Posted December 23, 2013 Thanks! It worked great Link to comment https://forums.phpfreaks.com/topic/284908-rotate-image-string-vertical-ie-top-to-bottom/#findComment-1463007 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.