两张图片合并成一张解决方法

两张图片合并成一张
有身份证正反面两张图片,现在想用C# 在winform 将这张图片合并在一张图片。

------解决方案--------------------

public Bitmap Join(params Bitmap[] bmp)
        {
            int width = bmp.OrderBy(d => d.Width).Last().Width;
            int height = 0;
            foreach (var item in bmp)
            {
                height += item.Height;
            }
            Bitmap res = new Bitmap(width, height);
            int now = 0;
            foreach (var item in bmp)
            {
                for (int i = 0; i < item.Width; i++)
                {
                    for (int k = 0; k < item.Height; k++)
                    {
                        res.SetPixel(i, k + now, item.GetPixel(i, k));
                    }
                }
                now += item.Height;
            }
            return res;
        }

------解决方案--------------------

Bitmap XXXX(Bitmap b1,Bitmap b2)
{
    Bitmap newBitmap=new Bitmap(Math.Max(b1.Width,b2.Width),b1.Height+b2.Height);
    Graphics g=Graphics.FromImage(newBitmap);
    g.DrawImage(b1,0,0);
    g.DrawImage(b2,0,b1.Height);
    g.Dispose();
    return newBitmap;
}

------解决方案--------------------
引用:
Quote: 引用:


Bitmap XXXX(Bitmap b1,Bitmap b2)
{
    Bitmap newBitmap=new Bitmap(Math.Max(b1.Width,b2.Width),b1.Height+b2.Height);
    Graphics g=Graphics.FromImage(newBitmap);
    g.DrawImage(b1,0,0);
    g.DrawImage(b2,0,b1.Height);
    g.Dispose();
    return newBitmap;
}
两张图片合并成一张解决方法我去 不会用这种简单的方法。。。
两张图片合并成一张解决方法
这下被奥把马给坑了
------解决方案--------------------
两张图片合并成一张解决方法