Ranjeeth kumar

Ranjeeth kumar

  • 2.1k
  • 5
  • 2.2k

How can i display 3 images into single image in asp.net

Dec 15 2016 6:57 AM
using (Bitmap FinalBitmap = new Bitmap(Math.Max(img2.Width, Math.Max(img1.Width, img2.Width)),img1.Height + img2.Height + img3.Height))
using (Graphics FinalImage = Graphics.FromImage(FinalBitmap))
// Draw the first image staring at point (0,0) with actual width and height of the image, in final image
FinalImage.DrawImage(img1, new Rectangle(0, 0, img1.Width, img1.Height));
// and Draw the second image staring at point where first image ends in the final image and save changes
FinalImage.DrawImage(img2, 0, img1.Height);
FinalImage.DrawImage(img3, 0,img2.Height);

// Write the bitmap to an image file and you’re done
MergedCombinedImage.ImageUrl = "~/ResultImages/Outputimg.jpg";
2 and 3 images are not formed well can anyone please help me.
Thank you

Answers (1)