By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,501 Members | 2,871 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,501 IT Pros & Developers. It's quick & easy.

Import images to a new image ?

P: 1
[PHP]<?
header("Content-type: image/jpeg");
$im = @imagecreatefromjpeg("test.jpg");
$im1 = @imagecreatefromjpeg("test1.jpg");
if (!$im)
$im = imagecreatetruecolor(150, 30);
$bgc = imagecolorallocate($im, 255, 255, 255);
$tc = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
imagestring($im, 1, 5, 5, "Error loading $imgname", $tc);
}
imagejpeg($im);
imagedestroy($im);
?>[/PHP]

I have the two "test.jpg" and "test1.jpg" and I want to show both of them in one new image. Can you tell me how to do please ?
Dec 13 '07 #1
Share this Question
Share on Google+
1 Reply


MarkoKlacar
Expert 100+
P: 296
Hi,

what you need to do is create a new image using the imagecreatetruecolor function. When you have looked at this function you'll need to use the imagecopyresampled in order to copy your images to the new "big" image.

Good luck
Dec 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.