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? Quote 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 (edited) 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 December 23, 2013 by Ch0cu3r Quote 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. Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.