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 |
How to concatenate two strings in php?
What is json php?
where do we use htaccess?
What is the php function that removes the last element of the array and returns it?
Does php need html?
What is the purpose of $_ session?
What is The difference between ' and " where they can ben in between or outmost and how
What is the use of Php variables?
How can we submit form without a submit button?
Tell me what is the use of "ksort" in php?
how to select the multiple data in selection button
When do sessions end?