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 does odbc do in context with php?
What are the advantages of php mysql?
What are examples of dependent variables?
Why is php used for web development?
How can we submit form without a submit button?
What does the unlink() function means?
Does php support overloading?
How to convert strings to upper or lower cases?
What is a trait in php?
Want to know the 10th max salary in salary table
What are the limitations or drawbacks of PHP ?
Tell me is it possible to protect special characters in a query string?