Example usage for android.graphics PixelFormat RGBA_4444

List of usage examples for android.graphics PixelFormat RGBA_4444

Introduction

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

Prototype

int RGBA_4444

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

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://from w ww  .  j av a  2 s .  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:/* w w  w  .  j a  v a2 s .  c  om*/
        return PixelFormat.RGBA_8888;
    }
}