Example usage for android.graphics PixelFormat A_8

List of usage examples for android.graphics PixelFormat A_8

Introduction

In this page you can find the example usage for android.graphics PixelFormat A_8.

Prototype

int A_8

To view the source code for android.graphics PixelFormat A_8.

Click Source Link

Usage

From source file:Main.java

@SuppressWarnings("deprecation")
public static Bitmap.Config getBitmapConfig(int pixelFormat) {
    switch (pixelFormat) {
    case PixelFormat.RGBA_4444:
        return Bitmap.Config.ARGB_4444;
    case PixelFormat.RGB_565:
        return Bitmap.Config.RGB_565;
    case PixelFormat.A_8:
        return Bitmap.Config.ALPHA_8;
    default://ww w. java  2s.c  om
        return Bitmap.Config.ARGB_8888;
    }
}

From source file:Main.java

@SuppressWarnings("deprecation")
public static int getPixelFormat(Bitmap.Config bitmapConfig) {
    switch (bitmapConfig) {
    case ARGB_4444:
        return PixelFormat.RGBA_4444;
    case RGB_565:
        return PixelFormat.RGB_565;
    case ALPHA_8:
        return PixelFormat.A_8;
    default://from  w w  w .  j  av a2s  .c o  m
        return PixelFormat.RGBA_8888;
    }
}