Use this when loading the bitmap:

http://developer.android.com/reference/android/graphics/BitmapFactory.Options.html#inPreferredConfig

Note the comment about images being loaded in ARGB_8888 by default applies
to 2.3 and  up.

On Fri, May 13, 2011 at 4:40 AM, delta42 <[email protected]> wrote:

> Very interesting, this is indeed the problem. Thanks for your answer,
> I would have wasted another 3 hours at least getting here otherwise.
>
> My mask identifies 11 distinct regions by using
>
> RGB(250,250,250)
> RGB(225,225,225)
> RGB(200,200,200)
> RGB(175,175,175)
> RGB(150,150,150)
> RGB(125,125,125)
> RGB(100,100,100)
> RGB(75,75,75)
> RGB(50,50,50)
> RGB(25,25,25)
> RGB(0,0,0)
>
> (I figured I would just divide Color.red(colour) by 25 to get the
> item's index)
>
> and they come out as
>
> RGB(247,251,247)
> RGB(222,227,222)
> RGB(197,198,197)
> RGB(173,174,173)
> etc..
>
> so the fact that the green stands out is a clear indication that the
> RGB565 pre-conversion is at fault.
>
> My not-so-elegant solution for now will be to average the 3 RGB values
> and then round it off to the nearest multiple of 25.
>
> Of course this begs for a better solution, but life goes on...
> Perhaps when I have time I will write a function to load a raw matrix
> from file to not give Android a chance to mangle my bits.
>
> Thanks again Ralf,
> /d42
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to