Jump to content

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


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);
?>

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.