Use as follows:
var Ima = Image.FromFile(@"C:\Users\PC\Desktop\kOWnj.jpg");
var Imb = Image.FromFile(@"C:\Users\PC\Desktop\AlaDL.jpg");
Image IMGfinal = MergeTwoImages(Ima, Imb);
I’ve done with both images:
public Bitmap MergeTwoImages(Image ImagemA, Image ImagemB)
{
if (ImagemA == null)
{
throw new ArgumentNullException("ImagemA");
}
if (ImagemB == null)
{
throw new ArgumentNullException("ImagemB");
}
int outputImageWidth = ImagemA.Width + ImagemB.Width;
int outputImageHeight = ImagemA.Height + ImagemB.Height;
int imagemAx = 0;
int imagemAy = 100;
int imagemBx = 140;
int imagemBy = -10;
Bitmap outputImage = new Bitmap(outputImageWidth, outputImageHeight, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
using (Graphics graphics = Graphics.FromImage(outputImage))
{
graphics.FillRectangle(new SolidBrush(Color.White), new Rectangle(new Point(), new Size(outputImageWidth,outputImageHeight))); //fundo branco
graphics.DrawImage(ImagemA, new Rectangle(new Point(imagemAx, imagemAy), ImagemA.Size), new Rectangle(new Point(), ImagemA.Size), GraphicsUnit.Pixel);//imagem 1
graphics.DrawImage(ImagemB, new Rectangle(new Point(imagemBx, imagemBy), ImagemB.Size), new Rectangle(new Point(), ImagemB.Size), GraphicsUnit.Pixel);//imagem 2
}
return outputImage;
}
You also find other ways in this link.
Just take the MARGIN properties of the images and change them
– PauloHDSousa