简体   繁体   中英

Save changed image in c# using graphic and bitmap

I read an image and print some text on it as you can see .

Bitmap bmp = new Bitmap(@"d:\a.jpg");
RectangleF rectf = new RectangleF(70, 90, 90, 50);
Graphics g = Graphics.FromImage(bmp);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.DrawString("yourText", new Font("Tahoma", 8), Brushes.Black, rectf);
g.Flush();

How can i save my image and these changes in another location of my computer ?

Dispose Graphics object

g.Dispose();

And save Bitmap

bmp.Save(fileName);

Here you have all Bitmap methods include different versions of Save

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM