Android bitmap quality issues

前端 未结 1 2048
春和景丽
春和景丽 2020-12-17 04:11

In my app, the bitmap is drawn as if the color is some lower quality type. If i load up the background image using the gallery app, it loads just fine and does not look like

相关标签:
1条回答
  • 2020-12-17 04:59

    question is somewhat similar to Bad image quality after resizing/scaling bitmap

    try disabling scaling, resize in an offscreen bitmap and make sure that Bitmap is 32 bits (ARGB888):

    Options options = new BitmapFactory.Options();
    options.inScaled = false;
    options.inDither = false;
    options.inPreferredConfig = Bitmap.Config.ARGB_8888;
    Bitmap source = BitmapFactory.decodeResource(a.getResources(), path, options);
    

    another good and complete answer about image scaling/processing can be found at Quality problems when resizing an image at runtime

    0 讨论(0)
提交回复
热议问题