How can I rotate an image?
Answer / jude jeevanraj.p
Probably not something you will want to do a lot of in
ordinary day PHP use, but if you want to rotate an image
use the well-named imagerotate function.
This takes the image to rotate, the angle of rotation, and
a color to fill the blank space around the rotated image
with.
Here's an example:
<?php
$original = imagecreatefrompng("myimage.png");
$red = imageColorAllocate($original,255,0,0);
imagerotate($original,50,$red);
header("content-type:image/png");
imagepng($rotated);
imagedestroy($original);
imagedestroy($rotated);
?>
| Is This Answer Correct ? | 5 Yes | 0 No |
What is the difference between query and question?
How check field is empty or not in php?
What is needed to be able to use image function?
How to get elements in reverse order of an array in php?
Does wordpress still use php?
What is the difference between php and cakephp?
What is memcache?
Is age interval or ordinal data?
What are the encryption functions in php?
What is difference between echo and print in php?
Is PHP runs on different platforms (Windows, Linux, Unix, etc.)?
How can we encrypt the username and password using PHP?
3 Answers Rushmore Consultancy,