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 |
Is runtime polymorphism overriding?
Why do we use query?
What's the difference between using mysql_ functions and pdo?
What is include in php?
How to get the directory name out of a file path name?
Is php still used?
What beforeFilter() is used?
Is apache needed for php?
What is php beginner?
Do you know what does mvc stand for and what does each component do?
What are the advantages of not using any frameworks ?
How can we know the total number of elements of Array?