GD Image change to Random Image already Created

killer999

Newbie
Joined
May 23, 2010
Messages
18
Reaction score
1
I want to change this code, so i can upload a random image hosted by me from a list of images, to a user album by a facebook app instead of creat a image by GD.


What i need to do??


Code:
$canvas = imagecreatefromjpeg ("bg.jpg");                                   // background image file
$black = imagecolorallocate( $canvas, 61, 61, 61 );                         // The second colour - to be used for the text
$font = "font.ttf";                                                         // Path to the font you are going to use                                                         // font size

imagettftext( $canvas, 15, -1, 51, 60, $black, $font, $name );
imagettftext( $canvas, 15, -1, 51, 200, $black, $font, $friend );

imagejpeg( $canvas, "img/".$fbid.".jpg", 50 );

ImageDestroy( $canvas );

header("Location: ".$scripturl."upload.php?id=".$fbid."&friends=".$friends."")
?>
 
Back
Top