PHP Questions Home
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How can I rotate an image?


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);
?>



ASK A QUESTION

More images PHP Questions

I have a text query, but I added images (small jpgs), I am not sure but it looks like it is creating/saving the files in a tmp folder each time a visitor requests the query. Is there a efficient way to run a query calling images? I noticed some PHP progr

How create albums as Facebook in Php by using code igniter

How can I find the colour of a pixel of an image?

How can I add text to an image?

how can i load images with php?



Custom Search