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 the scope of variables mean?
Which is better python or php?
Is php difficult to learn?
Do you know what is the function mysql_pconnect() usefull for?
What is polymorphism with example in php?
What is inheritance in php? How many types of inheritance supports php?
What are different ways to redirect from on page to other?
Which function can be used to delete a file?
What is difference between compile time and run time polymorphism?
What is $_ get and $_ post in php?
In How many ways can u represent Not equal?Give Syntax of all ways..
What is $_ post in php?