Ranjeeth kumar

Ranjeeth kumar

  • NA
  • 5
  • 2.7k

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);

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

Answers (1)