Jump to content

Simple GD Question/help


nbarone

Recommended Posts

I am trying to load in a PNG image, and place a number on top of it. This code is not outputting anything (not even an error):

<?php
// define base image
$base = ($_GET['hover']=='true')?"/images/assets/sel_hover.png":"/images/assets/sel.png";

// create image
$image = imagecreatefrompng($base);

// define colors
$black = imagecolorallocate($image, 0, 0, 0);		// text

// define font file
$font = "helvetica.ttf"; 

// define incremental number
$num = $_GET['inc'];

// define header
header ("Content-type: image/png"); 

// write text to image
imagettftext($image,10,0,3,3,$black,$font,$num);

// display image
imagepng($image);
imagedestroy($image);

?>

 

Link to comment
https://forums.phpfreaks.com/topic/197774-simple-gd-questionhelp/
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.