|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ICanvas
Defines the methods to draw the possible objects.
Method Summary | |
---|---|
void |
cleanCanvas()
Clears the canvas. |
void |
drawBitmap(int[] colors,
int offset,
int stride,
float x,
float y,
int width,
int height,
boolean hasAlpha)
Treat the specified array of colors as a bitmap, and draw it. |
void |
drawCircle(float x,
float y,
float radius,
IColor p)
Draws a filled circle. |
void |
drawDrawable(Drawable image)
Draws the specified drawable image. |
void |
drawLine(float x1,
float y1,
float x2,
float y2,
IColor p)
Draws a line. |
void |
drawRect(float x1,
float y1,
float x2,
float y2,
IColor p)
Draws a filled rectangle. |
void |
drawText(java.lang.String m,
float x,
float y,
IColor p)
Draws a text. |
Canvas |
getAndroidCanvas()
Get the inner Canvas ; can be used to draw complicated shapes
beyond what this interface offers. |
Method Detail |
---|
void drawLine(float x1, float y1, float x2, float y2, IColor p)
x1
- coordinate of the beginning of the line.y1
- coordinate of the beginning of the line.x2
- coordinate of the end of the line.y2
- coordinate of the end of the line.p
- object that holds the color of the line.void drawRect(float x1, float y1, float x2, float y2, IColor p)
x1
- The left side of the rectangle to be drawn.y1
- The top side of the rectangle to be drawn.x2
- The right side of the rectangle to be drawn.y2
- The bottom side of the rectangle to be drawn.p
- object that holds the color of the rectangle.void drawCircle(float x, float y, float radius, IColor p)
x
- coordinate of the canvas panel.y
- coordinate of the canvas panel.radius
- of the circle.p
- object that holds the color of the circle.void drawText(java.lang.String m, float x, float y, IColor p)
m
- The text to be drawn.x
- The x-coordinate of the origin of the text being drawn.y
- The y-coordinate of the origin of the text being drawn.p
- object that holds the color of the text.void drawBitmap(int[] colors, int offset, int stride, float x, float y, int width, int height, boolean hasAlpha)
colors
- Array of colors representing the pixels of the bitmap.offset
- into the array of colors for the first pixel.stride
- The number of colors in the array between rows (must be >=
width or <= -width).x
- The X coordinate for where to draw the bitmap.y
- The Y coordinate for where to draw the bitmap.width
- The width of the bitmap.height
- The height of the bitmap.hasAlpha
- True if the alpha channel of the colors contains valid values.
If false, the alpha byte is ignored (assumed to be 0xFF for
every pixel).void drawDrawable(Drawable image)
image
- the Drawable
to be drawnvoid cleanCanvas()
Canvas getAndroidCanvas()
Canvas
; can be used to draw complicated shapes
beyond what this interface offers.
Canvas
object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |