Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import android.graphics.PixelFormat;

public class Main {
    @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:
            return Bitmap.Config.ARGB_8888;
        }
    }
}