I gotten some great help debugging the script I'm working on, but I have one problem left to overcome.
Quote
Update:
I've built a simple page that shows what I'm trying to do, and what's happening. A picture is worth a 1000 words, and I'm not sure I've described the problem clearly enough.
Take a look here: Sample Page
I've built a simple page that shows what I'm trying to do, and what's happening. A picture is worth a 1000 words, and I'm not sure I've described the problem clearly enough.
Take a look here: Sample Page
I get the same result with both imagecopy and imagecopymerge. The resulting image shows only the background image. I've swapped the two images, and again, only the first (background) image shows in the result.
The intended result is that the background image is covered by the non-transparent parts of the second image.
Here's the code:
<?php
#$basedir="/LeenaLures/images/Custom Lure pics/LureParts/";
$basedir="../images/Custom Lure pics/LureParts/";
$SizeFolder = "1024x768/";
$BackgroundImg = "background_03.png";
#$BackgroundImg = "jig.png";
$tmp_image = $basedir.$SizeFolder.$BackgroundImg;
if (file_exists($tmp_image)) {
if (1==1) {
$imBg = imagecreatefrompng($tmp_image);
$ImgX = imagesx($imBg);
$Imgy = imagesy($imBg);
#$ImgX = 1024;
#$ImgY = 768;
$tmp_image = $basedir.$SizeFolder."jig.png";
# $tmp_image = $basedir.$SizeFolder."background_03.png";
$imJig = imagecreatefrompng($tmp_image);
imagecopymerge($imBg, $imJig, 0, 0, 0, 0, $ImgX, $ImgY,100);
# imagecopymerge($imBg, $imJig, 0, 0, 0, 0, $ImgX, $ImgY,100);
# imagecopy($imBg, $imJig, 0, 0, 0, 0, $ImgX, $ImgY);
header("Content-Type: image/png");
header("Last-Modified: $last_modified");
header("File-Name:test.png");
imagepng($imBg);
imagedestroy($imBg);
imagedestroy($imJig);
} else {
header("Content-Type: text/txt");
header("File-Name:test.txt");
echo "File Found: ".$tmp_image;
}
} else {
header("Content-Type: text/txt");
header("File-Name:test.txt");
echo "File Not Found: ".$tmp_image;
}
?>
If someone help me find the right answer to getting the desired result - before I pull out all my hair ;) -- It would be greatly appreciated!!Also, thanks to all that helped me get the script working so far!!!! :thumbup:
Sloan
Edited by SloanThrasher, 29 June 2010 - 11:20 AM.


Sign In
Create Account

Back to top










