Hi all,
I'm trying to read the color values of a PNG, to do that I do the following:
- Load the image into a Bitmap
- Draw the bitmap inside a RenderTarget
- Then I read color values pixel by pixel
The problem is that RenderTarget seems to return wrong values for some pixels. Consider the following image
When calling RenderTarget:getPixel() on fully transparent pixels it returns the correct values for them (color = 0x000000, alpha = 0), but for other pixels that are "black" it returns again the previous values (color = 0x000000, alpha = 0).
Due to this fact I'm unable to distinguish between fully transparent pixels and opaque black ones.
Anyone have encountered the same issue and knows how to overcome this obstacle?
Thank you.
Comments
Thank you for your help.
Likes: MoKaLux
Maybe that can help?
PS: I don't know if it is clean code. Does it even answer your original question? I think I got lost here!
Likes: antix
Yes the code is clear and in general it is the same thing I do. Thank you for your help
Mauro
Likes: MoKaLux
Likes: antix