Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

PHP image help


ghost's Avatar
0 0

Hey guys,

I am using PHP and the GD library to create a dynamic profile badge. The badge is made up of an image as a background, and has text on it about the user. My problem is that when I add the avatar picture, all the text and other graphics disappearā€¦

$im is my background image $avstring contains the avatar as a string

Here is a code snippit:

$av = imagecreatefromstring($avstring); 
imagecopy($im, $av, 15, 15, 0, 0, 100, 100);

$black = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 5, 155, 35, "Name: ".$usr["Name"], $black);
imagestring($im, 5, 155, 55, "Pub: ".$usr["pub"], $black);

I then render the image, and the avatar loads fine, but my text is goneā€¦

Any ideas?

Cheers


ghost's Avatar
0 0

Solved, had to put the imagecopy command at the end, just before rendering.

B)