public class Canvas extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Canvas.EdgeType |
static class |
Canvas.VertexMode |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALL_SAVE_FLAG |
static int |
CLIP_SAVE_FLAG |
static int |
CLIP_TO_LAYER_SAVE_FLAG |
static int |
FULL_COLOR_LAYER_SAVE_FLAG |
static int |
HAS_ALPHA_LAYER_SAVE_FLAG |
static int |
MATRIX_SAVE_FLAG |
| Modifier and Type | Method and Description |
|---|---|
boolean |
clipPath(Path path) |
boolean |
clipPath(Path path,
Region.Op op) |
boolean |
clipRect(float left,
float top,
float right,
float bottom) |
boolean |
clipRect(float left,
float top,
float right,
float bottom,
Region.Op op) |
boolean |
clipRect(int left,
int top,
int right,
int bottom) |
boolean |
clipRect(Rect rect) |
boolean |
clipRect(RectF rect) |
boolean |
clipRect(RectF rect,
Region.Op op) |
boolean |
clipRect(Rect rect,
Region.Op op) |
boolean |
clipRegion(Region region) |
boolean |
clipRegion(Region region,
Region.Op op) |
void |
concat(Matrix matrix) |
void |
drawArc(RectF oval,
float startAngle,
float sweepAngle,
boolean useCenter,
Paint paint) |
void |
drawARGB(int a,
int r,
int g,
int b) |
void |
drawBitmap(Bitmap bitmap,
float left,
float top,
Paint paint) |
void |
drawBitmap(Bitmap bitmap,
Matrix matrix,
Paint paint) |
void |
drawBitmap(Bitmap bitmap,
Rect src,
RectF dst,
Paint paint) |
void |
drawBitmap(Bitmap bitmap,
Rect src,
Rect dst,
Paint paint) |
void |
drawBitmap(int[] colors,
int offset,
int stride,
float x,
float y,
int width,
int height,
boolean hasAlpha,
Paint paint) |
void |
drawBitmap(int[] colors,
int offset,
int stride,
int x,
int y,
int width,
int height,
boolean hasAlpha,
Paint paint) |
void |
drawBitmapMesh(Bitmap bitmap,
int meshWidth,
int meshHeight,
float[] verts,
int vertOffset,
int[] colors,
int colorOffset,
Paint paint) |
void |
drawCircle(float cx,
float cy,
float radius,
Paint paint) |
void |
drawColor(int color) |
void |
drawColor(int color,
PorterDuff.Mode mode) |
void |
drawLine(float startX,
float startY,
float stopX,
float stopY,
Paint paint) |
void |
drawLines(float[] pts,
int offset,
int count,
Paint paint) |
void |
drawLines(float[] pts,
Paint paint) |
void |
drawOval(RectF oval,
Paint paint) |
void |
drawPaint(Paint paint) |
void |
drawPath(Path path,
Paint paint) |
void |
drawPicture(Picture picture) |
void |
drawPicture(Picture picture,
Rect dst) |
void |
drawPicture(Picture picture,
RectF dst) |
void |
drawPoint(float x,
float y,
Paint paint) |
void |
drawPoints(float[] pts,
int offset,
int count,
Paint paint) |
void |
drawPoints(float[] pts,
Paint paint) |
void |
drawPosText(char[] text,
int index,
int count,
float[] pos,
Paint paint)
Deprecated.
|
void |
drawPosText(String text,
float[] pos,
Paint paint)
Deprecated.
|
void |
drawRect(float left,
float top,
float right,
float bottom,
Paint paint) |
void |
drawRect(RectF rect,
Paint paint) |
void |
drawRect(Rect r,
Paint paint) |
void |
drawRGB(int r,
int g,
int b) |
void |
drawRoundRect(RectF rect,
float rx,
float ry,
Paint paint) |
void |
drawText(char[] text,
int index,
int count,
float x,
float y,
Paint paint) |
void |
drawText(CharSequence text,
int start,
int end,
float x,
float y,
Paint paint) |
void |
drawText(String text,
float x,
float y,
Paint paint) |
void |
drawText(String text,
int start,
int end,
float x,
float y,
Paint paint) |
void |
drawTextOnPath(char[] text,
int index,
int count,
Path path,
float hOffset,
float vOffset,
Paint paint) |
void |
drawTextOnPath(String text,
Path path,
float hOffset,
float vOffset,
Paint paint) |
void |
drawVertices(Canvas.VertexMode mode,
int vertexCount,
float[] verts,
int vertOffset,
float[] texs,
int texOffset,
int[] colors,
int colorOffset,
short[] indices,
int indexOffset,
int indexCount,
Paint paint) |
Rect |
getClipBounds() |
boolean |
getClipBounds(Rect bounds) |
int |
getDensity() |
DrawFilter |
getDrawFilter() |
int |
getHeight() |
Matrix |
getMatrix()
Deprecated.
|
void |
getMatrix(Matrix ctm)
Deprecated.
|
int |
getMaximumBitmapHeight() |
int |
getMaximumBitmapWidth() |
int |
getSaveCount() |
int |
getWidth() |
boolean |
isHardwareAccelerated() |
boolean |
isOpaque() |
boolean |
quickReject(float left,
float top,
float right,
float bottom,
Canvas.EdgeType type) |
boolean |
quickReject(Path path,
Canvas.EdgeType type) |
boolean |
quickReject(RectF rect,
Canvas.EdgeType type) |
void |
restore() |
void |
restoreToCount(int saveCount) |
void |
rotate(float degrees) |
void |
rotate(float degrees,
float px,
float py) |
int |
save() |
int |
save(int saveFlags) |
int |
saveLayer(float left,
float top,
float right,
float bottom,
Paint paint,
int saveFlags) |
int |
saveLayer(RectF bounds,
Paint paint,
int saveFlags) |
int |
saveLayerAlpha(float left,
float top,
float right,
float bottom,
int alpha,
int saveFlags) |
int |
saveLayerAlpha(RectF bounds,
int alpha,
int saveFlags) |
void |
scale(float sx,
float sy) |
void |
scale(float sx,
float sy,
float px,
float py) |
void |
setBitmap(Bitmap bitmap) |
void |
setDensity(int density) |
void |
setDrawFilter(DrawFilter filter) |
void |
setMatrix(Matrix matrix) |
void |
skew(float sx,
float sy) |
void |
translate(float dx,
float dy) |
public static final int MATRIX_SAVE_FLAG
public static final int CLIP_SAVE_FLAG
public static final int HAS_ALPHA_LAYER_SAVE_FLAG
public static final int FULL_COLOR_LAYER_SAVE_FLAG
public static final int CLIP_TO_LAYER_SAVE_FLAG
public static final int ALL_SAVE_FLAG
public Canvas()
public Canvas(Bitmap bitmap)
public boolean isHardwareAccelerated()
public void setBitmap(Bitmap bitmap)
public boolean isOpaque()
public int getWidth()
public int getHeight()
public int getDensity()
public void setDensity(int density)
public int getMaximumBitmapWidth()
public int getMaximumBitmapHeight()
public int save()
public int save(int saveFlags)
public int saveLayer(float left,
float top,
float right,
float bottom,
Paint paint,
int saveFlags)
public int saveLayerAlpha(RectF bounds, int alpha, int saveFlags)
public int saveLayerAlpha(float left,
float top,
float right,
float bottom,
int alpha,
int saveFlags)
public void restore()
public int getSaveCount()
public void restoreToCount(int saveCount)
public void translate(float dx,
float dy)
public void scale(float sx,
float sy)
public final void scale(float sx,
float sy,
float px,
float py)
public void rotate(float degrees)
public final void rotate(float degrees,
float px,
float py)
public void skew(float sx,
float sy)
public void concat(Matrix matrix)
public void setMatrix(Matrix matrix)
@Deprecated public void getMatrix(Matrix ctm)
@Deprecated public final Matrix getMatrix()
public boolean clipRect(RectF rect)
public boolean clipRect(Rect rect)
public boolean clipRect(float left,
float top,
float right,
float bottom,
Region.Op op)
public boolean clipRect(float left,
float top,
float right,
float bottom)
public boolean clipRect(int left,
int top,
int right,
int bottom)
public boolean clipPath(Path path)
public boolean clipRegion(Region region)
public DrawFilter getDrawFilter()
public void setDrawFilter(DrawFilter filter)
public boolean quickReject(RectF rect, Canvas.EdgeType type)
public boolean quickReject(Path path, Canvas.EdgeType type)
public boolean quickReject(float left,
float top,
float right,
float bottom,
Canvas.EdgeType type)
public boolean getClipBounds(Rect bounds)
public final Rect getClipBounds()
public void drawRGB(int r,
int g,
int b)
public void drawARGB(int a,
int r,
int g,
int b)
public void drawColor(int color)
public void drawColor(int color,
PorterDuff.Mode mode)
public void drawPaint(Paint paint)
public void drawPoints(float[] pts,
int offset,
int count,
Paint paint)
public void drawPoints(float[] pts,
Paint paint)
public void drawPoint(float x,
float y,
Paint paint)
public void drawLine(float startX,
float startY,
float stopX,
float stopY,
Paint paint)
public void drawLines(float[] pts,
int offset,
int count,
Paint paint)
public void drawLines(float[] pts,
Paint paint)
public void drawRect(float left,
float top,
float right,
float bottom,
Paint paint)
public void drawCircle(float cx,
float cy,
float radius,
Paint paint)
public void drawArc(RectF oval, float startAngle, float sweepAngle, boolean useCenter, Paint paint)
public void drawBitmap(int[] colors,
int offset,
int stride,
float x,
float y,
int width,
int height,
boolean hasAlpha,
Paint paint)
public void drawBitmap(int[] colors,
int offset,
int stride,
int x,
int y,
int width,
int height,
boolean hasAlpha,
Paint paint)
public void drawBitmapMesh(Bitmap bitmap, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, Paint paint)
public void drawVertices(Canvas.VertexMode mode, int vertexCount, float[] verts, int vertOffset, float[] texs, int texOffset, int[] colors, int colorOffset, short[] indices, int indexOffset, int indexCount, Paint paint)
public void drawText(char[] text,
int index,
int count,
float x,
float y,
Paint paint)
public void drawText(CharSequence text, int start, int end, float x, float y, Paint paint)
@Deprecated public void drawPosText(char[] text, int index, int count, float[] pos, Paint paint)
@Deprecated public void drawPosText(String text, float[] pos, Paint paint)
public void drawTextOnPath(char[] text,
int index,
int count,
Path path,
float hOffset,
float vOffset,
Paint paint)
public void drawTextOnPath(String text, Path path, float hOffset, float vOffset, Paint paint)
public void drawPicture(Picture picture)
Copyright © 2008-2013. All Rights Reserved.