未验证 提交 b237cb2c 编写于 作者: O openharmony_ci 提交者: Gitee

!10242 绘制组件示例图挑单到3.2beta3

Merge pull request !10242 from 田雨/cherry-pick-1664502415
......@@ -24,17 +24,17 @@ Line(value?: {width?: string | number, height?: string | number})
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- |
| width | string \| number | 否 | 0 | 宽度。 |
| height | string \| number | 否 | 0 | 高度。 |
| width | string \| number | 否 | 0 | 宽度。 |
| height | string \| number | 否 | 0 | 高度。 |
## 属性
除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性:
| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- |
| startPoint | Array<Length> | [0, 0] | 否 | 直线起点坐标点(相对坐标),单位vp。 |
| endPoint | Array<Length> | [0, 0] | 否 | 直线终点坐标点(相对坐标),单位vp。 |
......@@ -86,4 +86,4 @@ struct LineExample {
}
```
![zh-cn_image_0000001219982725](figures/zh-cn_image_0000001219982725.jpg)
![zh-cn_image_0000001219982725](figures/zh-cn_image_0000001219982725.png)
......@@ -18,17 +18,17 @@ Polygon(value?: {width?: string | number, height?: string | number})
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- |
| width | string \| number | 否 | 0 | 宽度。 |
| height | string \| number | 否 | 0 | 高度。 |
| width | string \| number | 否 | 0 | 宽度。 |
| height | string \| number | 否 | 0 | 高度。 |
## 属性
除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性:
| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- |
| points | Array<Point> | [] | 否 | 多边形的顶点坐标列表。 |
| fill | [ResourceColor](ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 |
......@@ -81,4 +81,4 @@ struct PolygonExample {
}
```
![zh-cn_image_0000001174582856](figures/zh-cn_image_0000001174582856.gif)
![zh-cn_image_0000001174582856](figures/zh-cn_image_0000001174582856.png)
......@@ -18,19 +18,19 @@ Polyline(value?: {width?: string | number, height?: string | number})
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- |
| width | string \| number | 否 | 0 | 宽度。 |
| height | string \| number | 否 | 0 | 高度。 |
| width | string \| number | 否 | 0 | 宽度。 |
| height | string \| number | 否 | 0 | 高度。 |
## 属性
除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性:
| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- |
| points | Array<Point> | [] | 否 | 折线经过坐标点列表。 |
| points | Array<Point> | [] | 否 | 折线经过坐标点列表。 |
| fill | [ResourceColor](ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 |
| fillOpacity | number \| string \| [Resource](ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 |
| stroke | [ResourceColor](ts-types.md) | Color.Black | 否 | 设置线条颜色。 |
......@@ -83,4 +83,4 @@ struct PolylineExample {
}
```
![zh-cn_image_0000001219744185](figures/zh-cn_image_0000001219744185.gif)
![zh-cn_image_0000001219744185](figures/zh-cn_image_0000001219744185.png)
......@@ -23,9 +23,9 @@ Shape(value?: PixelMap)
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- |
| value | PixelMap | 否 | - | 绘制目标,可将图形绘制在指定的PixelMap对象中,若未设置,则在当前绘制目标中进行绘制。 |
| value | PixelMap | 否 | - | 绘制目标,可将图形绘制在指定的PixelMap对象中,若未设置,则在当前绘制目标中进行绘制。 |
## 属性
......@@ -48,7 +48,9 @@ Shape(value?: PixelMap)
| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 |
| mesh<sup>8+</sup> | Array&lt;number&gt;,number,number | [],0,0 | 否 | 设置mesh效果。第一个参数为长度(column + 1)* (row + 1)* 2的数组,它记录了扭曲后的位图各个顶点位置,第二个参数为mesh矩阵列数column,第三个参数为mesh矩阵行数row。 |
## 示例1
## 示例
### 示例1
```ts
// xxx.ets
......@@ -142,8 +144,9 @@ struct ShapeExample {
}
```
![zh-cn_image_0000001184628104](figures/zh-cn_image_0000001184628104.png)
## 示例2
### 示例2
```ts
// xxx.ets
......@@ -222,3 +225,11 @@ struct ShapeMeshExample {
}
}
```
示意图:
![zh-cn_image1_0000001184628104](figures/zh-cn_image1_0000001184628104.png)
手指触摸Shape组件时会显示mesh扭曲效果:
![zh-cn_image2_0000001184628104](figures/zh-cn_image2_0000001184628104.png)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册