且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从2个不同的图像创建新的图像C#

更新时间:2023-12-05 16:41:10

using (Image background = Image.FromFile("background.jpg"))
using (Image qrCode = Image.FromFile("qrCode.jpg"))
using (Graphics graphics = Graphics.FromImage(background))
{
    int x = 100;
    int y = 100;
    graphics.DrawImage(qrCode, x, y);
    background.Save("result.jpg", ImageFormat.Jpeg);
}