We would like to know how to get red, green, blue alpha bytes from Bitmap.
// w ww .ja va2s .c om import android.graphics.Bitmap; import android.graphics.Matrix; public class Main { static int getRedBytes(final Bitmap.Config config) { switch (config) { case RGB_565: return 5; case ARGB_4444: return 4; default: return 8; } } static int getGreenBytes(final Bitmap.Config config) { switch (config) { case RGB_565: return 6; case ARGB_4444: return 4; default: return 8; } } static int getBlueBytes(final Bitmap.Config config) { switch (config) { case RGB_565: return 5; case ARGB_4444: return 4; default: return 8; } } static int getAlphaBytes(final Bitmap.Config config) { switch (config) { case RGB_565: return 0; case ARGB_4444: return 4; default: return 8; } } }