Android Question draw bitmap transparent ...

ilan

Expert
Licensed User
Longtime User
hi

i have an image and i would like to draw the image with canvas to my panel and i would like to draw the image but a specific color should be transparent like

i have in my image a white frame and i would like to draw the image but the white frame should be drawn transparent and the image inside should be draw as is...

is this possible?

thanx in advance
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
I'd love to know that too.
However, if you want to do it the other way you can just use a transparent PNG file. Run it through TinyPNG.com to keep the filesize down.
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
If i think about it again i think i know how it can be done.

Just need to get evey pixel with bitmap.getpixel and if is white draw transparent else draw as is...

will need to make some tests when i get home :)
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
why don't you make the white area transparent in your source picture?
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
Because my picture frame is not a square i want to make a puzzle game

If the draw.path would have also radius and not only lines i would creat a path but you can only add line to the path
 
Upvote 0
Top