简体   繁体   中英

How to convert a color (in RGB mode) to transparent color for PNG using C#?

I will be converting a jpg to png and than I wish to remove an RGB color with values (254,242,211) to a transparent color in PNG using C#. Can anyone point me to a good tutorial and/or code?

Try to do folowing:

Bitmap bmp = new Bitmap(_jpegFilePath);
bmp.MakeTransparent(Color.FromArgb(254,242,211));
bmp.Save(_pngFilePath);

Should work.

Regards.

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