提交 a2e7b86c 编写于 作者: G Gloria

Update docs against 11105

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 d02dd0eb
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
The Native Drawing module provides APIs for drawing 2D graphics and text. The following scenarios are common for drawing development: The Native Drawing module provides APIs for drawing 2D graphics and text. The following scenarios are common for drawing development:
* Drawing 2D graphics * Drawing 2D graphics
* Drawing and painting text * Drawing text drawing
## Available APIs ## Available APIs
| API| Description| | API| Description|
| -------- | -------- | | -------- | -------- |
| OH_Drawing_BitmapCreate (void) | Creates a bitmap object.| | OH_Drawing_BitmapCreate (void) | Creates a bitmap object.|
| OH_Drawing_BitmapBuild (OH_Drawing_Bitmap *, const uint32_t width, const uint32_t height, const OH_Drawing_BitmapFormat *) | Initializes the width and height of a bitmap object and sets the pixel format for the bitmap.| | OH_Drawing_BitmapBuild (OH_Drawing_Bitmap *, const uint32_t width, const uint32_t height, const OH_Drawing_BitmapFormat *) | Initializes the width and height of a bitmap object and sets the pixel format for the bitmap.|
...@@ -19,7 +19,7 @@ The Native Drawing module provides APIs for drawing 2D graphics and text. The fo ...@@ -19,7 +19,7 @@ The Native Drawing module provides APIs for drawing 2D graphics and text. The fo
| OH_Drawing_CanvasDrawPath (OH_Drawing_Canvas *, const OH_Drawing_Path *) | Draws a path.| | OH_Drawing_CanvasDrawPath (OH_Drawing_Canvas *, const OH_Drawing_Path *) | Draws a path.|
| OH_Drawing_PathCreate (void) | Creates a path object.| | OH_Drawing_PathCreate (void) | Creates a path object.|
| OH_Drawing_PathMoveTo (OH_Drawing_Path *, float x, float y) | Sets the start point of a path.| | OH_Drawing_PathMoveTo (OH_Drawing_Path *, float x, float y) | Sets the start point of a path.|
| OH_Drawing_PathLineTo (OH_Drawing_Path *, float x, float y) | Draws a line segment from the last point of a path to the target point. | | OH_Drawing_PathLineTo (OH_Drawing_Path *, float x, float y) | Draws a line segment from the last point of a path to the target point.|
| OH_Drawing_PathClose (OH_Drawing_Path *) | Closes a path. A line segment from the start point to the last point of the path is added.| | OH_Drawing_PathClose (OH_Drawing_Path *) | Closes a path. A line segment from the start point to the last point of the path is added.|
| OH_Drawing_PenCreate (void) | Creates a pen object.| | OH_Drawing_PenCreate (void) | Creates a pen object.|
| OH_Drawing_PenSetAntiAlias (OH_Drawing_Pen *, bool) | Checks whether anti-aliasing is enabled for a pen. If anti-aliasing is enabled, edges will be drawn with partial transparency.| | OH_Drawing_PenSetAntiAlias (OH_Drawing_Pen *, bool) | Checks whether anti-aliasing is enabled for a pen. If anti-aliasing is enabled, edges will be drawn with partial transparency.|
...@@ -138,7 +138,7 @@ The following steps describe how to use the canvas and brush of the Native Drawi ...@@ -138,7 +138,7 @@ The following steps describe how to use the canvas and brush of the Native Drawi
OH_Drawing_BitmapDestory(cBitmap); OH_Drawing_BitmapDestory(cBitmap);
``` ```
## Development Procedure for Text Drawing and Display ## Development Procedure for Text Drawing
The following steps describe how to use the text drawing and display feature of the Native Drawing module. The following steps describe how to use the text drawing and display feature of the Native Drawing module.
1. **Create a canvas and a bitmap.** 1. **Create a canvas and a bitmap.**
...@@ -196,7 +196,8 @@ The following steps describe how to use the text drawing and display feature of ...@@ -196,7 +196,8 @@ The following steps describe how to use the text drawing and display feature of
// Set the maximum width. // Set the maximum width.
double maxWidth = 800.0; double maxWidth = 800.0;
OH_Drawing_TypographyLayout(typography, maxWidth); OH_Drawing_TypographyLayout(typography, maxWidth);
// Set the start position for text display. // Set the start position for drawing the text on the canvas.
double position[2] = {10.0, 15.0}; double position[2] = {10.0, 15.0};
// Draw the text on the canvas.
OH_Drawing_TypographyPaint(typography, cCanvas, position[0], position[1]); OH_Drawing_TypographyPaint(typography, cCanvas, position[0], position[1]);
``` ```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册