可能重复:
将两张图片合并为一张新图片
我有创建 2 个图像的 ac# 代码;现在我想通过将第一张图片放在第二张图片上方来加入他们?
这是我到目前为止所做的:
var myBitmap = new Bitmap(longestLine * 40, 40);
var g = Graphics.FromImage(myBitmap);
g.Clear(Color.White);
var strFormat = new StringFormat { Alignment = StringAlignment.Center };
g.DrawString(FirstLine, new Font("Free 3 of 9", 40), Brushes.Black, new RectangleF(0, 0, longestLine * 40, totalLines * 40), strFormat);
var myBitmap2 = new Bitmap(longestLine * 40, 40);
var g2 = Graphics.FromImage(myBitmap2);
g2.Clear(Color.White);
var strFormat2 = new StringFormat { Alignment = StringAlignment.Center };
g2.DrawString(SecondLine, new Font("Free 3 of 9", 40), Brushes.Black, new RectangleF(0, 0, longestLine * 40, totalLines * 40), strFormat);