【发布时间】:2015-01-12 10:00:01
【问题描述】:
我有 3 个图片框,绿色是 1 个,这两个图像在两个不同的图片框中。我想将所有图片框拼接成一张 .jpg 图像,保留所有图像的位置。任何人都可以帮我解决代码。 4天以来一直在抓挠我的头:(
提前致谢
【问题讨论】:
标签: c# .net save jpeg picturebox
我有 3 个图片框,绿色是 1 个,这两个图像在两个不同的图片框中。我想将所有图片框拼接成一张 .jpg 图像,保留所有图像的位置。任何人都可以帮我解决代码。 4天以来一直在抓挠我的头:(
提前致谢
【问题讨论】:
标签: c# .net save jpeg picturebox
Bitmap bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
pictureBox1.DrawToBitmap(bmp, new Rectangle(0,0,pictureBox1.Width, pictureBox1.Height));
pictureBox2.DrawToBitmap(bmp, new Rectangle(pictureBox2.Location.X - pictureBox1.Location.X, pictureBox2.Location.Y - pictureBox1.Location.Y, pictureBox2.Width, pictureBox2.Height));
pictureBox3.DrawToBitmap(bmp, new Rectangle(pictureBox3.Location.X - pictureBox1.Location.X, pictureBox3.Location.Y - pictureBox1.Location.Y, pictureBox3.Width, pictureBox3.Height));
bmp.Save(@"C:\Temp\output.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
【讨论】: