Jump to content

simple imagecopymerge code (just don't know what's wrong)


yekis

Recommended Posts

when i preview my php file in a browser, no image appears...don't know what's wrong with my code....tnx

 

<?php
{
   header ("Content-type: image/png"); 
//define images

  $background = imagecreatefrompng("background.png");    
  $overlay = imagecreatefrompng("logo.png");
  
   
  imagecopymerge($background, $overlay, 0,0,0,0,480,360,100); 
  
  imagepng($background,"",100); 
  
  imagedestroy($background);     
}

?> 

 

 

 

[attachment deleted by admin]

yes they are saved in the same directory...here's the exact "error" i get when i preview my file in the ff: browsers

 

1. internet explorer (see attachment)

 

   

 

2. firefox..the screen simply dislays the url in the window

 

http://localhost/delete2.php

 

 

[attachment deleted by admin]

try this

<?php
header ("Content-type: image/png");
$background = imagecreatefrompng("background.png");
$insert = imagecreatefrompng("logo.png");
imagecopymerge($background, $insert, 0, 0, 0, 0, 480, 360, 30);
imagepng($background);
imagedestroy($background);
?>

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.