public static interface Component.DrawTask
You can use Component.addDrawTask(ohos.agp.components.Component.DrawTask) and Component.addDrawTask(ohos.agp.components.Component.DrawTask,int) to add
a draw
task in a control, and invoke the callback when the control is updated by Component.invalidate().
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
BETWEEN_BACKGROUND_AND_CONTENT |
Indicates that the draw task is implemented between the content and background of a control.
|
static int |
BETWEEN_CONTENT_AND_FOREGROUND |
Indicates that the draw task is implemented between the content and foreground of a control.
|
static final int BETWEEN_BACKGROUND_AND_CONTENT
static final int BETWEEN_CONTENT_AND_FOREGROUND
void onDraw(Component component, Canvas canvas)
The draw task uses the attributes of the parent canvas for drawing an object, such as alpha, width, and height.
component - Indicates the parent canvas.canvas - Indicates the canvas used for drawing in this draw task.Component.addDrawTask(DrawTask),
Component.addDrawTask(DrawTask, int),
Component.invalidate()