Jump to content

Overlaying 2 Images at a 45deg angle


a1amattyj

Recommended Posts

Hello,

 

I've got 2 images (please see attached: top3.jpg, side4.jpt) (using these 2 as an example)

 

I want to overlay them onto the image (also attached temp1.jpg)

 

However, the corner gets cut off, as can be seen (temp3.jpg)

 

Im wondering if I can overlay them using PHP at the 45deg angle?

 

Currently using

 

	$dest = imagecreatefromjpeg($source);
$src = imagecreatefromjpeg($image);


if($part == 1)
{
// main image
	imagecopymerge($dest, $src, 0, 80, 0, 0, 321, 321, 100);
}
else if($part == 2)
{
// the top image
	imagecopymerge($dest, $src, 0, 0, 0, 0, 401, 80, 100);
}
else if($part == 3)
{
// the side image on the right
	imagecopymerge($dest, $src, 321, 1, 0, 0, 80, 401, 100);
}

imagejpeg($dest, $save);

imagedestroy($dest);
imagedestroy($src);

 

Thank you!

post-58709-13482403435872_thumb.jpg

post-58709-13482403436003_thumb.jpg

post-58709-13482403436132_thumb.jpg

post-58709-13482403436287_thumb.jpg

Link to comment
Share on other sites

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.