日期:2014-05-17 浏览次数:21173 次
private void Save_Click(object sender, EventArgs e)
{
SaveFileDialog s = new SaveFileDialog();
s.Title = "保存图像";
s.Filter = "PNG(*.png)|*.png|JPEG(*.jpg)|*.jpg|BMP(*.bmp)|*.bmp";
if (s.ShowDialog() == DialogResult.OK)
{
CombinImage(pictureBox1.Image, pictureBox2.Image, pictureBox3.Image, pictureBox4.Image, pictureBox5.Image, pictureBox6.Image, pictureBox7.Image).Save(s.FileName);
}
}
public static Image CombinImage(Image sourceImg, Image destImg1, Image destImg2, Image destImg3, Image destImg4, Image destImg5, Image destImg6)
{
Image imgBack = new System.Drawing.Bitmap(sourceImg);
Image img1 = new System.Drawing.Bitmap(destImg1);
Image img2 = new System.Drawing.Bitmap(destImg2);
Image img3 = new System.Drawing.Bitmap(destImg3);
Image img4 = new System.Drawing.Bitmap(destImg4);
Image img5 = new System.Drawing.Bitmap(destImg5);
Image img6 = new System.Drawing.Bitmap(destImg6);
Graphics g1 = Graphics.FromImage(imgBack);
Graphics g2 = Graphics.FromImage(imgBack);
Graphics g3 = Graphics.FromImage(imgBack);
Graphics g4 = Graphics.FromImage(imgBack);
Graphics g5 = Graphics.FromImage(imgBack);
Graphics g6 = Graphics.FromImage(imgBack);
g1.DrawImage(img1, 33, 12, 21, 41);
g2.DrawImage(img2, 69, 12, 21, 41);