Jump to content


PHP GD Help


  • You cannot reply to this topic
No replies to this topic

#1 Eliterate

    Young Padawan

  • Members
  • Pip
  • 20 posts
  • Gender:Male
  • Location:Ontario, Canada

Posted 24 November 2007 - 05:01 PM

Alright so, What I want to do is submit a form with 2 things,

String, or word, and font.

when t submits I want to make an image with the word with the selected font. But the font isnt preset font, its seperate images like a.gif, b.gif etc.

Right now, I have it so it displays the images, but its all on top of eachother (overlapping) and if try to put an offset, a black background appears and covers the whole thing..

My Code:
<?php
header("Content-type: image/gif");
$string = $_GET['string'];
$string = urlencode($string);
$strtolower = strtolower($string);
$length = strlen($strtolower);
$font = $_GET['font'];

$im = imagecreatefromgif("Iced/+.gif");
$white = ImageColorAllocate ($im, 255, 255, 255);
$black = ImageColorAllocate ($im, 0, 0, 0);

for( $i = 0; $i < $length; $i++) {
$text = imagecreatefromgif($font."/".$strtolower[$i].".gif");
$size = GetImageSize($font."/".$strtolower[$i].".gif");
$image_w = imagesx($text);
$image_h = imagesy($text);
imagecopy($im, $text, 0, 0, 0, 0, $image_w,$image_h);
}

imagegif($im);
imagedestroy($im);
?>






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users