PHP rotate image

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ra
Forum Commoner
Posts: 58
Joined: Fri Mar 25, 2005 4:25 pm

PHP rotate image

Post by ra »

How would I use 3 buttons to rotate an image in the same space?

BUTTON 1 BUTTON 2 BUTTON 3

<image1, 2, or 3 based on the click.>

Is this even possible?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

live on a page, you store the already rotated images in something like Javascript. If you want server interaction (which is where php would get involved) you would use GD to rotate the image data.
ra
Forum Commoner
Posts: 58
Joined: Fri Mar 25, 2005 4:25 pm

Post by ra »

know where i could find examples of the javascript that does this?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it'd be just like Javascript rollover code

Code: Select all

var images = new Array();
images[0] = new Image();
images[0].src = 'zeroDegrees.gif';
images[1] = new Image();
images[1].src = 'nintyDegrees.gif';
images[2] = new Image();
images[2].src = 'oneEightyDegrees.gif';
images[3] = new Image();
images[3].src = 'twoSeventyDegrees.gif';

---------

onclick="someObj.src = images[2].src;"
Post Reply