views:

15

answers:

0

I have a bitmap file, that serves as a mask for a view. It has multiple rectangular areas with different colors on a white background. When the user touches the View, I use the X and Y coords of this event to look up the color of the mask (which is not displayed) and do things based on the color code returned.

The problem is: loading this mask with BitmapFactory results in a Bitmap object that is scaled. This way the colors get distorted a bit. If I have e.g. a solid rectangle with color (155, 155, 0), then it'll be like (148, 158, 0), (150, 154, 0), and so on. But I need to get the exact color.

So how do I load the raw bitmap, without any scaling / compressing / stuff like that?