提交 65af486c 编写于 作者: E ester.zhou

update ts-offscreencanvasrenderingcontext2d.md (8536)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 4fc94f66
...@@ -273,7 +273,7 @@ struct MiterLimit { ...@@ -273,7 +273,7 @@ struct MiterLimit {
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct Font { struct Fonts {
private settings: RenderingContextSettings = new RenderingContextSettings(true) private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private offContext: OffscreenCanvasRenderingContext2D = new OffscreenCanvasRenderingContext2D(600, 600, this.settings) private offContext: OffscreenCanvasRenderingContext2D = new OffscreenCanvasRenderingContext2D(600, 600, this.settings)
...@@ -728,7 +728,7 @@ Fills a rectangle on the canvas. ...@@ -728,7 +728,7 @@ Fills a rectangle on the canvas.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct FillRect { struct FillRect {
...@@ -773,7 +773,8 @@ Draws an outlined rectangle on the canvas. ...@@ -773,7 +773,8 @@ Draws an outlined rectangle on the canvas.
- Example - Example
``` ```ts
// xxx.ets
@Entry @Entry
@Component @Component
struct StrokeRect { struct StrokeRect {
...@@ -818,7 +819,7 @@ Clears the content in a rectangle on the canvas. ...@@ -818,7 +819,7 @@ Clears the content in a rectangle on the canvas.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct ClearRect { struct ClearRect {
...@@ -864,7 +865,7 @@ Draws filled text on the canvas. ...@@ -864,7 +865,7 @@ Draws filled text on the canvas.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct FillText { struct FillText {
...@@ -908,7 +909,8 @@ Draws a text stroke on the canvas. ...@@ -908,7 +909,8 @@ Draws a text stroke on the canvas.
- Example - Example
``` ```ts
// xxx.ets
@Entry @Entry
@Component @Component
struct StrokeText { struct StrokeText {
...@@ -961,7 +963,7 @@ Returns a **TextMetrics** object used to obtain the width of specified text. ...@@ -961,7 +963,7 @@ Returns a **TextMetrics** object used to obtain the width of specified text.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct MeasureText { struct MeasureText {
...@@ -1004,7 +1006,8 @@ Strokes a path. ...@@ -1004,7 +1006,8 @@ Strokes a path.
- Example - Example
``` ```ts
// xxx.ets
@Entry @Entry
@Component @Component
struct Stroke { struct Stroke {
...@@ -1044,7 +1047,7 @@ Creates a drawing path. ...@@ -1044,7 +1047,7 @@ Creates a drawing path.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct BeginPath { struct BeginPath {
...@@ -1092,7 +1095,7 @@ Moves a drawing path to a target position on the canvas. ...@@ -1092,7 +1095,7 @@ Moves a drawing path to a target position on the canvas.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct MoveTo { struct MoveTo {
...@@ -1138,7 +1141,7 @@ Connects the current point to a target position using a straight line. ...@@ -1138,7 +1141,7 @@ Connects the current point to a target position using a straight line.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct LineTo { struct LineTo {
...@@ -1178,7 +1181,7 @@ Draws a closed path. ...@@ -1178,7 +1181,7 @@ Draws a closed path.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct ClosePath { struct ClosePath {
...@@ -1226,7 +1229,7 @@ Creates a pattern for image filling based on a specified source image and repeti ...@@ -1226,7 +1229,7 @@ Creates a pattern for image filling based on a specified source image and repeti
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct CreatePattern { struct CreatePattern {
...@@ -1276,7 +1279,7 @@ Draws a cubic bezier curve on the canvas. ...@@ -1276,7 +1279,7 @@ Draws a cubic bezier curve on the canvas.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct BezierCurveTo { struct BezierCurveTo {
...@@ -1324,7 +1327,7 @@ Draws a quadratic curve on the canvas. ...@@ -1324,7 +1327,7 @@ Draws a quadratic curve on the canvas.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct QuadraticCurveTo { struct QuadraticCurveTo {
...@@ -1374,7 +1377,7 @@ Draws an arc on the canvas. ...@@ -1374,7 +1377,7 @@ Draws an arc on the canvas.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct Arc { struct Arc {
...@@ -1422,7 +1425,7 @@ Draws an arc based on the radius and points on the arc. ...@@ -1422,7 +1425,7 @@ Draws an arc based on the radius and points on the arc.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct ArcTo { struct ArcTo {
...@@ -1474,7 +1477,7 @@ Draws an ellipse in the specified rectangular region. ...@@ -1474,7 +1477,7 @@ Draws an ellipse in the specified rectangular region.
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct CanvasExample { struct CanvasExample {
...@@ -1521,7 +1524,7 @@ Creates a rectangle. ...@@ -1521,7 +1524,7 @@ Creates a rectangle.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct CanvasExample { struct CanvasExample {
...@@ -1559,7 +1562,7 @@ Fills the area inside a closed path. ...@@ -1559,7 +1562,7 @@ Fills the area inside a closed path.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct Fill { struct Fill {
...@@ -1597,7 +1600,7 @@ Sets the current path to a clipping path. ...@@ -1597,7 +1600,7 @@ Sets the current path to a clipping path.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct Clip { struct Clip {
...@@ -1643,7 +1646,7 @@ Rotates a canvas clockwise around its coordinate axes. ...@@ -1643,7 +1646,7 @@ Rotates a canvas clockwise around its coordinate axes.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct Rotate { struct Rotate {
...@@ -1687,7 +1690,7 @@ Scales a canvas based on scale factors. ...@@ -1687,7 +1690,7 @@ Scales a canvas based on scale factors.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct Scale { struct Scale {
...@@ -1743,7 +1746,7 @@ Defines a transformation matrix. To transform a graph, you only need to set para ...@@ -1743,7 +1746,7 @@ Defines a transformation matrix. To transform a graph, you only need to set para
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct Transform { struct Transform {
...@@ -1797,7 +1800,7 @@ Resets the existing transformation matrix and creates a new transformation matri ...@@ -1797,7 +1800,7 @@ Resets the existing transformation matrix and creates a new transformation matri
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct SetTransform { struct SetTransform {
...@@ -1844,7 +1847,7 @@ Moves the origin of the coordinate system. ...@@ -1844,7 +1847,7 @@ Moves the origin of the coordinate system.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct Translate { struct Translate {
...@@ -1901,7 +1904,7 @@ Draws an image. ...@@ -1901,7 +1904,7 @@ Draws an image.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct Index { struct Index {
...@@ -2002,7 +2005,7 @@ Puts the [ImageData](ts-components-canvas-imagebitmap.md) onto a rectangular are ...@@ -2002,7 +2005,7 @@ Puts the [ImageData](ts-components-canvas-imagebitmap.md) onto a rectangular are
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct PutImageData { struct PutImageData {
...@@ -2046,7 +2049,7 @@ Restores the saved drawing context. ...@@ -2046,7 +2049,7 @@ Restores the saved drawing context.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct CanvasExample { struct CanvasExample {
...@@ -2081,7 +2084,7 @@ Saves the current drawing context. ...@@ -2081,7 +2084,7 @@ Saves the current drawing context.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct CanvasExample { struct CanvasExample {
...@@ -2124,7 +2127,7 @@ Creates a linear gradient. ...@@ -2124,7 +2127,7 @@ Creates a linear gradient.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct CreateLinearGradient { struct CreateLinearGradient {
...@@ -2177,7 +2180,7 @@ Creates a linear gradient. ...@@ -2177,7 +2180,7 @@ Creates a linear gradient.
- Example - Example
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
@Component @Component
struct CreateRadialGradient { struct CreateRadialGradient {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册