FileDocCategorySizeDatePackage
BitmapShader.javaAPI DocAndroid 5.1 API1936Thu Mar 12 22:22:30 GMT 2015android.graphics

BitmapShader

public class BitmapShader extends Shader
Shader used to draw a bitmap as a texture. The bitmap can be repeated or mirrored by setting the tiling mode.

Fields Summary
public final Bitmap
mBitmap
Prevent garbage collection.
private TileMode
mTileX
private TileMode
mTileY
Constructors Summary
public BitmapShader(Bitmap bitmap, TileMode tileX, TileMode tileY)
Call this to create a new shader that will draw with a bitmap.

param
bitmap The bitmap to use inside the shader
param
tileX The tiling mode for x to draw the bitmap in.
param
tileY The tiling mode for y to draw the bitmap in.

        mBitmap = bitmap;
        mTileX = tileX;
        mTileY = tileY;
        final long b = bitmap.ni();
        init(nativeCreate(b, tileX.nativeInt, tileY.nativeInt));
    
Methods Summary
protected Shadercopy()

hide

        final BitmapShader copy = new BitmapShader(mBitmap, mTileX, mTileY);
        copyLocalMatrix(copy);
        return copy;
    
private static native longnativeCreate(long native_bitmap, int shaderTileModeX, int shaderTileModeY)