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 |
Tell me how to strip whitespace (or other characters) from the beginning and end of a string?
How to set a page as a home page in a php based site?
am fresher in php ..am finished my linux,apache,mysql,and php(LAMP) course please can any one tell openings for freshers in php ...And please tell how much i demand as a fresher in PHP field just say approximately or assumption ..? at present am staying in chennai am looking my job in chennai only or else in bangalore ... hello experts please answer this question ?
What are php errors?
How to create database connection and query in php?
what is the difference between GET and POST?
21 Answers AdVine, Evon Technologies, GVD Infotech, RedAlkemi, SoftSol,
What is mysqli php?
How to track user logged out or not? When user is idle?
What is input sanitization in php?
What is Mcrypt used for?
What is prepare in php?
How error handling is being handled by php?