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
https://forums.phpfreaks.com/topic/261331-overlaying-2-images-at-a-45deg-angle/
Share on other sites

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.