Android Question Make image background transparent?

Mashiane

Expert
Licensed User
Longtime User
Hi there

I'm looking for some code to make the white parts of my images to be transparent and save the resulting image.

This is what I have done so far.

I'm saving a panel to an image using PanelScreenShot, the image gets saved perfectly. I have attached one here too. Now I need to make the white background transparent.

Can someone please help? I have checked BitMapExtended however dont have an idea how to take this further as there are not examples of such. The attached image is WhiteSmoke though.

I just want to have the orange parts left and the rest transparent.
 

Attachments

  • fa-calendar.png
    fa-calendar.png
    2.8 KB · Views: 395

ivan.tellez

Active Member
Licensed User
Longtime User
With the BitMapExtended you can try the eraseColor function.

Or the fun way, check the color of each pixel with getPixel, if its the color you want to delete, use setPixel.
 
Upvote 0
Top