简体   繁体   中英

What is the easiest way to convert all the pixels of a specific color to transparent in a BMP?

Looking for the least painful way to grab a Bitmap and translate every pixel of a specific color to transparent.

In particular, I have set all the pixels I want to be transparent to 0xFF00FF, but I am not seeing any native method that do this.

Do I have to actually loop through all the pixels comparing values? And if so, can I change them in place or do I need to make a new bitmap array and create a new bitmap?

Bitmaps don't have alpha channels like PNG/GIF. It's up to the application to use a transparency mask.

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