protected static int getBytesPerPixel ( Bitmap . Config config ) { if ( config == Bitmap . Config . ARGB_8888 ) { return 4 ; } else if ( config == Bitmap . Config . RGB_565 ) { return 2 ; } else if ( config == Bitmap . Config . ARGB_4444 ) { return 2 ; } else if ( config == Bitmap . Config . ALPHA_8 ) { return 1 ; } return 1 ; }
Return the byte usage per pixel of a bitmap based on its configuration .