Jump to content

help rotating pics!!


jwk811

Recommended Posts

Use PHP:

 

<?php 

function rotateImage(){
// The file you are rotating
$image = 'http://assets.espn.go.com/i/ncaa/07mens_bracket.gif';

//How many degrees you wish to rotate
$degrees = -90;

// This sets the image type to .jpg but can be changed to png or gif
header('Content-type: image/gif') ;

// Create the canvas
$source = imagecreatefromgif($image) ;

// Rotates the image
$rotate = imagerotate($source, $degrees, 0) ;

// This shows the the image
imagegif($rotate);

//or

// This saves the image
//imagegif($rotate, 'NCAABracket.gif');
}
echo rotateImage();
?>

 

If you are rotating a JPG or PNG just change all the gif accordingly.

Link to comment
Share on other sites

Here's the javascript I use:

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = '../images/pic1.jpg'
theImages[1] = '../images/pic2.jpg'
theImages[2] = '../images/pic3.jpg'
theImages[3] = '../images/pic4.jpg'
theImages[4] = '../images/pic5.jpg'


// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

//  End -->
</script>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.