【问题标题】:How can I join two images one above another [duplicate]如何将两个图像叠加在一起[重复]
【发布时间】:2012-10-01 17:24:33
【问题描述】:

可能重复:
Combine two Images into one new Image

我有一个创建 2 个图像的 c# 代码;现在我想通过将第一张图片放在第二张图片上方来加入他们吗?

这是我到目前为止所做的:

        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);

【问题讨论】:

标签: c# winforms image bitmap


【解决方案1】:

Combine two Images into one new Image 用于并排添加两个位图。我自己用过,感觉还不错。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-09-17
    • 1970-01-01
    • 2018-11-08
    • 1970-01-01
    • 1970-01-01
    • 2010-10-13
    • 2021-12-13
    相关资源
    最近更新 更多