Thanks David for you reply.  You can see that in my onCreat() function
i create the bit map using this"bitmap = Bitmap.createBitmap(100, 100,
true); " From the decompiled source code we can see this:
////////////////////////
public static Bitmap createBitmap(int width, int height, boolean
hasAlpha)
    {
        return createBitmap(width, height, hasAlpha ?
Config.ARGB_8888 : Config.RGB_565);
    }
////////////////////////
So i create the Bitmap with the Config.ARGB_8888. But the result the
same. Pixel changed. It is quite strange.


On Apr 8, 6:01 pm, David Given <[EMAIL PROTECTED]> wrote:
> Gibson wrote:
>
> [...]
>
> >    protected void onDraw(Canvas canvas) {
> >            Paint paint = new Paint();
> >            paint.setARGB(255, 255, 255, 255);
> >            canvas.drawRect(0, 0, screenWidth, screenHeight, paint);
> >            canvas.drawBitmap(bitmap, 10, 10, null);
> >            int[] imagedata = new int[100 * 100];
> >            bitmap.getPixels(imagedata, 0, 100, 0, 0, 100, 100);
> >            bitmap.setPixels(imagedata, 0, 100, 0, 0, 100, 100);
>
> Without knowing for certain, I suspect that yourbitmapis in RGB565
> format. Pixel data is always in ARGB888 format, so whenever you call
> setPixels() it does lossy format conversion. You may want to turn off
> dithering, as this will introduce noise.
>
> --
> David Given
> [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to