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
https://forums.phpfreaks.com/topic/257126-gd-library-pattern-background/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.