开发者

Image Processing In c#,.net

开发者 https://www.devze.com 2022-12-15 12:58 出处:网络
I want to create a small application that allows me to insert an image on top of another image.And also i want to insert some text as well.

I want to create a small application that allows me to insert an image on top of another image.And also i want to insert some text as well.

So can someone points me out where to start.Is there any open source libraries that allows 开发者_开发技巧me to do this task?.

I am after a solution that can be implemented in C#,Visual Studio .net.

Thanks.


You need to use the Graphics class.

For example:

using(var oldImage = Bitmap.FromFile(path))
using(var newImage = new Bitmap(250, 250))
using(var graphics = Graphics.FromImage(newImage)) {
    graphics.DrawImage(oldImage, 10, 15);
    graphics.DrawString("Hello, world!", SystemFonts.DefaultFont, Brushes.Red, 0, 0);
    newImage.Save(path);
}


Try ImageMagick.Net. Lotsa stuff in there.


You should be OK using System.Drawing.Graphics if you don't need anything too fancy.

0

精彩评论

暂无评论...
验证码 换一张
取 消