|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.graphics.drawable.Drawable
android.graphics.drawable.PictureDrawable
public class PictureDrawable
Drawable subclass that wraps a Picture, allowing the picture to be used whereever a Drawable is supported.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class android.graphics.drawable.Drawable |
|---|
Drawable.Callback, Drawable.ConstantState |
| Field Summary |
|---|
| Fields inherited from class android.graphics.drawable.Drawable |
|---|
mCallback |
| Constructor Summary | |
|---|---|
PictureDrawable(Picture picture)
Construct a new drawable referencing the specified picture. |
|
| Method Summary | |
|---|---|
void |
draw(Canvas canvas)
Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter). |
int |
getIntrinsicHeight()
Return the intrinsic height of the underlying drawable object. |
int |
getIntrinsicWidth()
Return the intrinsic width of the underlying drawable object. |
int |
getOpacity()
Return the opacity/transparency of this Drawable. |
Picture |
getPicture()
Return the picture associated with the drawable. |
void |
setAlpha(int alpha)
Specify an alpha value for the drawable. |
void |
setColorFilter(ColorFilter colorFilter)
Specify an optional colorFilter for the drawable. |
void |
setDither(boolean dither)
Set to true to have the drawable dither its colors when drawn to a device with fewer than 8-bits per color component. |
void |
setFilterBitmap(boolean filter)
Set to true to have the drawable filter its bitmap when scaled or rotated (for drawables that use bitmaps). |
void |
setPicture(Picture picture)
Associate a picture with this drawable. |
| Methods inherited from class android.graphics.drawable.Drawable |
|---|
clearColorFilter, copyBounds, copyBounds, createFromPath, createFromStream, createFromXml, createFromXmlInner, getBounds, getChangingConfigurations, getConstantState, getCurrent, getLevel, getMinimumHeight, getMinimumWidth, getPadding, getState, getTransparentRegion, inflate, inflateWithAttributes, invalidateSelf, isStateful, isVisible, onBoundsChange, onLevelChange, onStateChange, resolveOpacity, scheduleSelf, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setLevel, setState, setVisible, unscheduleSelf |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PictureDrawable(Picture picture)
picture - The picture to associate with the drawable. May be null.| Method Detail |
|---|
public Picture getPicture()
public void setPicture(Picture picture)
picture - The picture to associate with the drawable. May be null.public void draw(Canvas canvas)
Drawable
draw in class Drawablecanvas - The canvas to draw intopublic int getIntrinsicWidth()
Drawable
getIntrinsicWidth in class Drawablepublic int getIntrinsicHeight()
Drawable
getIntrinsicHeight in class Drawablepublic int getOpacity()
DrawablePixelFormat:
PixelFormat.UNKNOWN,
PixelFormat.TRANSLUCENT,
PixelFormat.TRANSPARENT, or
PixelFormat.OPAQUE.
Generally a Drawable should be as conservative as possible with the
value it returns. For example, if it contains multiple child drawables
and only shows one of them at a time, if only one of the children is
TRANSLUCENT and the others are OPAQUE then TRANSLUCENT should be
returned. You can use the method Drawable.resolveOpacity(int, int) to perform a
standard reduction of two opacities to the appropriate single output.
Note that the returned value does not take into account a
custom alpha or color filter that has been applied by the client through
the Drawable.setAlpha(int) or Drawable.setColorFilter(android.graphics.ColorFilter) methods.
getOpacity in class DrawablePixelFormatpublic void setFilterBitmap(boolean filter)
Drawable
setFilterBitmap in class Drawablepublic void setDither(boolean dither)
Drawable
setDither in class Drawablepublic void setColorFilter(ColorFilter colorFilter)
Drawable
setColorFilter in class Drawablepublic void setAlpha(int alpha)
Drawable
setAlpha in class Drawable
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||