How can I rotate an image?
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);
?>
Comment on this Question and Answer >>>
ASK A QUESTION
More images PHP Questions
how to rotate an image using php code?How can I find the width and height of an image resource?
how can i load images with php?
How can I find the colour of a pixel of an image?
How to display multiple images in a form path came from database and images are store in Image folder(assume 10 images are uploded that i want to display)
