Create a bitmap with some color. - Android Graphics

Android examples for Graphics:Bitmap Color

Description

Create a bitmap with some color.

Demo Code


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

public class Main {
    /**// w  w  w .  j  av a2  s  .  c  o m
     * Create a bitmap with some color.
     *
     * @param config Bitmap config.
     * @return A bitmap.
     */
    public static Bitmap createQuadColorBitmap(Bitmap.Config config) {
        return Bitmap.createBitmap(new int[] { Color.RED, Color.GREEN,
                Color.BLUE, Color.YELLOW }, 2, 2, config);
    }
}

Related Tutorials