Jump to content

GD Library Pattern Background ?


ttmt

Recommended Posts

GD Library Pattern Background ?

 

Hi all

 

I have a simple page here that uses the GD Library

to display text in a selected font and size etc.

 

http://www.ttmt.org.uk/forum/

 

At moment the stripped background goes from the code.

Is there a way to have an image as the background instead

of the stripped background.

 

PHP code

 

<?php
        
header('Content-Type: image/png');

$im = imagecreatetruecolor(900, 215);

$w = imagecolorallocate($im, 255, 255, 255);
$c = imagecolorallocate($im, 220, 220, 220);
$black = imagecolorallocatealpha($im, 0, 0, 0, 20);
$style = array($w,$w,$w,$c,$c,$c);
ImageSetStyle($im, $style);

ImageLine($image, 100, 0, 50, 50, IMG_COLOR_STYLED);
imagefilledrectangle($im, 0, 0, 900, 214, IMG_COLOR_STYLED);
    
  $text = $_GET['text'];
$textSize = $_GET['size'];
$font = $_GET['font'];
	  
  imagefttext($im, $textSize, 0, 15, 165, $black, $font, $text);		

imagepng($im);

imagedestroy($im);

?>

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.