I tried this code:
private void CreateAnimatedGif(string FileName1 , string FileName2)
{
Bitmap file1 = new Bitmap(FileName1);
Bitmap file2 = new Bitmap(FileName2);
Bitmap bitmap = new Bitmap(file1.Width + file2.Width, Math.Max(file1.Height, file2.Height));
using (Graphics g = Graphics.FromImage(bitmap))
{
g.DrawImage(file1, 0, 0);
g.DrawImage(file2, file1.Width, 0);
}
bitmap.Save(@"d:\test.gif", System.Drawing.Imaging.ImageFormat.Gif);
}
In general it's working. But the result is not good enough.
The first image since the code try to make it in same size in the height I see some black space on the bottom.
The second image is bigger then the first one. The second image is on the right. So I need that it will make the left image the first one to be the same size/resolution of the second one.
How can I fix this code for that?
This is an example of the new image result after combined the two. And why it's not good as I wanted: