FileDocCategorySizeDatePackage
PictureDrawable.javaAPI DocAndroid 5.1 API2779Thu Mar 12 22:22:30 GMT 2015android.graphics.drawable

PictureDrawable

public class PictureDrawable extends android.graphics.drawable.Drawable
Drawable subclass that wraps a Picture, allowing the picture to be used wherever a Drawable is supported.

Fields Summary
private android.graphics.Picture
mPicture
Constructors Summary
public PictureDrawable(android.graphics.Picture picture)
Construct a new drawable referencing the specified picture. The picture may be null.

param
picture The picture to associate with the drawable. May be null.

        mPicture = picture;
    
Methods Summary
public voiddraw(android.graphics.Canvas canvas)

        if (mPicture != null) {
            Rect bounds = getBounds();
            canvas.save();
            canvas.clipRect(bounds);
            canvas.translate(bounds.left, bounds.top);
            canvas.drawPicture(mPicture);
            canvas.restore();
        }
    
public intgetIntrinsicHeight()

        return mPicture != null ? mPicture.getHeight() : -1;
    
public intgetIntrinsicWidth()

        return mPicture != null ? mPicture.getWidth() : -1;
    
public intgetOpacity()

        // not sure, so be safe
        return PixelFormat.TRANSLUCENT;
    
public android.graphics.PicturegetPicture()
Return the picture associated with the drawable. May be null.

return
the picture associated with the drawable, or null.

        return mPicture;
    
public voidsetAlpha(int alpha)

public voidsetColorFilter(android.graphics.ColorFilter colorFilter)

public voidsetDither(boolean dither)

public voidsetFilterBitmap(boolean filter)

public voidsetPicture(android.graphics.Picture picture)
Associate a picture with this drawable. The picture may be null.

param
picture The picture to associate with the drawable. May be null.

        mPicture = picture;