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 is the main function of php?
How can we extract string 'abc.com' from a string "http://info@abc.com" using regular expression of PHP
What is a definer in mysql?
Are parent constructors called implicitly inside a class constructor?
How can I prevent sql-injection in php?
What is zend studio for?
Explain what is smarty?
How many ways I can redirect a PHP page?
9 Answers MicroSec, N-Tier Business Solutions, University Exams,
What are the method available in form submitting?
Can I run php without xampp?
What is the current php version?
How does php and apache work?