110,570
社区成员
发帖
与我相关
我的任务
分享
Bitmap bmpNew = new Bitmap(img1.Width + img2.Width, img1.Height + img2.Height);
Graphics g = Graphics.FromImage(bmpNew);
using (g)
{
g.DrawImage(img1,new Point(0,0));
g.DrawImage(img2,new Point(img1.Width,0));// 左右
bmpNew.Save(@"c:\\demo.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
}
Bitmap b1;
Bitmap b2;
Bitmap b3 = new Bitmap(400, 100);
Graphics g = Graphics.FromImage(b3);
g.DrawImage(b1, new Rectangle(0, 0, 200, 100), new RectangleF(0, 0, 200, 100), GraphicsUnit.Pixel);
g.DrawImage(b2, new Rectangle(200, 0, 200, 100), new RectangleF(0, 0, 200, 100), GraphicsUnit.Pixel);
g.Dispose();
//b3 为横图