Mutate the bitmap and reset tilemode - Android android.graphics

Android examples for android.graphics:Bitmap Operation

Description

Mutate the bitmap and reset tilemode

Demo Code


//package com.java2s;

import android.graphics.Shader.TileMode;
import android.graphics.drawable.BitmapDrawable;

public class Main {
    /** Mutate the bitmap and reset tilemode **/
    public static void fixBitmapRepeat(BitmapDrawable bmp) {
        bmp.mutate(); // make sure that we aren't sharing state anymore
        bmp.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT);
    }//from   w  w  w . j  a  v a2  s  . c o m
}

Related Tutorials