get Alpha Bytes from Bitmap Config - Android Graphics

Android examples for Graphics:Bitmap Byte Array

Description

get Alpha Bytes from Bitmap Config

Demo Code


//package com.java2s;
import android.graphics.Bitmap;

public class Main {
    static int getAlphaBytes(final Bitmap.Config config) {
        switch (config) {
        case RGB_565:
            return 0;

        case ARGB_4444:
            return 4;

        default:/*w ww.  ja v  a  2 s. c o m*/
            return 8;
        }
    }
}

Related Tutorials