Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
683ed007
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
683ed007
编写于
10月 12, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 12, 2022
浏览文件
操作
浏览文件
下载
差异文件
!10515 绘制组件示例图挑单到3.2beta3
Merge pull request !10515 from 田雨/cherry-pick-1665542962
上级
b33ff3e3
714f75db
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
101 addition
and
49 deletion
+101
-49
zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image1_0000001219982725.png
...erence/arkui-ts/figures/zh-cn_image1_0000001219982725.png
+0
-0
zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219982725.png
...ference/arkui-ts/figures/zh-cn_image_0000001219982725.png
+0
-0
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-circle.md
...on-dev/reference/arkui-ts/ts-drawing-components-circle.md
+7
-7
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-ellipse.md
...n-dev/reference/arkui-ts/ts-drawing-components-ellipse.md
+7
-7
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md
...tion-dev/reference/arkui-ts/ts-drawing-components-line.md
+54
-2
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-path.md
...tion-dev/reference/arkui-ts/ts-drawing-components-path.md
+1
-1
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polygon.md
...n-dev/reference/arkui-ts/ts-drawing-components-polygon.md
+7
-7
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polyline.md
...-dev/reference/arkui-ts/ts-drawing-components-polyline.md
+1
-1
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md
...tion-dev/reference/arkui-ts/ts-drawing-components-rect.md
+16
-16
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-shape.md
...ion-dev/reference/arkui-ts/ts-drawing-components-shape.md
+8
-8
未找到文件。
zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image1_0000001219982725.png
0 → 100644
浏览文件 @
683ed007
5.8 KB
zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219982725.png
查看替换文件 @
b33ff3e3
浏览文件 @
683ed007
8.7 KB
|
W:
|
H:
24.7 KB
|
W:
|
H:
2-up
Swipe
Onion skin
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-circle.md
浏览文件 @
683ed007
...
@@ -30,14 +30,14 @@ Circle(options?: {width?: string | number, height?: string | number})
...
@@ -30,14 +30,14 @@ Circle(options?: {width?: string | number, height?: string | number})
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| fill |
[
ResourceColor
](
ts-types.md
)
| 否 | 设置填充区域颜色。
<br>
默认值:Color.Black |
| fill |
[
ResourceColor
](
ts-types.md
)
| 否 | 设置填充区域颜色。
<br>
默认值:Color.Black |
| fillOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 否 | 设置填充区域透明度。
<br>
默认值:1 |
| fillOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 否 | 设置填充区域透明度。
<br>
默认值:1 |
| stroke |
[
ResourceColor
](
ts-types.md
)
| 否 | 设置
线条颜色。
<br>
默认值:Color.Black
|
| stroke |
[
ResourceColor
](
ts-types.md
)
| 否 | 设置
边框颜色,不设置时,默认没有边框。
|
| strokeDashArray | Array
<
Length
>
| 否 | 设置
线条
间隙。
<br>
默认值:[] |
| strokeDashArray | Array
<
Length
>
| 否 | 设置
边框
间隙。
<br>
默认值:[] |
| strokeDashOffset | number
\|
string | 否 |
线条
绘制起点的偏移量。
<br>
默认值:0 |
| strokeDashOffset | number
\|
string | 否 |
边框
绘制起点的偏移量。
<br>
默认值:0 |
| strokeLineCap |
[
LineCapStyle
](
ts-appendix-enums.md#linecapstyle
)
| 否 | 设置
线条端点绘制样式。
<br>
默认值:LineCapStyle.Butt
|
| strokeLineCap |
[
LineCapStyle
](
ts-appendix-enums.md#linecapstyle
)
| 否 | 设置
边框端点绘制样式。
<br>
默认值:LineCapStyle.Butt
|
| strokeLineJoin |
[
LineJoinStyle
](
ts-appendix-enums.md#linejoinstyle
)
| 否 | 设置
线条
拐角绘制样式。
<br>
默认值:LineJoinStyle.Miter |
| strokeLineJoin |
[
LineJoinStyle
](
ts-appendix-enums.md#linejoinstyle
)
| 否 | 设置
边框
拐角绘制样式。
<br>
默认值:LineJoinStyle.Miter |
| strokeMiterLimit | number
\|
string | 否 | 设置锐角绘制成斜角的极限值。
<br>
默认值:4 |
| strokeMiterLimit | number
\|
string | 否 | 设置锐角绘制成斜角的极限值。
<br>
默认值:4 |
| strokeOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 否 | 设置
线条
透明度。
<br>
默认值:1 |
| strokeOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 否 | 设置
边框
透明度。
<br>
默认值:1 |
| strokeWidth | Length | 否 | 设置
线条
宽度。
<br>
默认值:1 |
| strokeWidth | Length | 否 | 设置
边框
宽度。
<br>
默认值:1 |
| antiAlias | boolean | 否 | 是否开启抗锯齿效果。
<br>
默认值:true |
| antiAlias | boolean | 否 | 是否开启抗锯齿效果。
<br>
默认值:true |
...
...
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-ellipse.md
浏览文件 @
683ed007
...
@@ -31,14 +31,14 @@ ellipse(options?: {width?: string | number, height?: string | number})
...
@@ -31,14 +31,14 @@ ellipse(options?: {width?: string | number, height?: string | number})
| -------- | -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| fill |
[
ResourceColor
](
ts-types.md
)
| Color.Black | 否 | 设置填充区域颜色。 |
| fill |
[
ResourceColor
](
ts-types.md
)
| Color.Black | 否 | 设置填充区域颜色。 |
| fillOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置填充区域透明度。 |
| fillOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置填充区域透明度。 |
| stroke |
[
ResourceColor
](
ts-types.md
)
|
Color.Black | 否 |设置线条颜色
。 |
| stroke |
[
ResourceColor
](
ts-types.md
)
|
- | 否 |设置边框颜色,不设置时,默认没有边框
。 |
| strokeDashArray | Array
<
Length
>
| [] | 否 | 设置
线条
间隙。 |
| strokeDashArray | Array
<
Length
>
| [] | 否 | 设置
边框
间隙。 |
| strokeDashOffset | number
\|
string | 0 | 否 |
线条
绘制起点的偏移量。 |
| strokeDashOffset | number
\|
string | 0 | 否 |
边框
绘制起点的偏移量。 |
| strokeLineCap |
[
LineCapStyle
](
ts-appendix-enums.md#linecapstyle
)
| LineCapStyle.Butt | 否 | 设置
线条
端点绘制样式。 |
| strokeLineCap |
[
LineCapStyle
](
ts-appendix-enums.md#linecapstyle
)
| LineCapStyle.Butt | 否 | 设置
边框
端点绘制样式。 |
| strokeLineJoin |
[
LineJoinStyle
](
ts-appendix-enums.md#linejoinstyle
)
| LineJoinStyle.Miter | 否 | 设置
线条
拐角绘制样式。 |
| strokeLineJoin |
[
LineJoinStyle
](
ts-appendix-enums.md#linejoinstyle
)
| LineJoinStyle.Miter | 否 | 设置
边框
拐角绘制样式。 |
| strokeMiterLimit | number
\|
string | 4 | 否 | 设置锐角绘制成斜角的极限值。 |
| strokeMiterLimit | number
\|
string | 4 | 否 | 设置锐角绘制成斜角的极限值。 |
| strokeOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置
线条
透明度。 |
| strokeOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置
边框
透明度。 |
| strokeWidth | Length | 1 | 否 | 设置
线条
宽度。 |
| strokeWidth | Length | 1 | 否 | 设置
边框
宽度。 |
| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 |
| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 |
...
...
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md
浏览文件 @
683ed007
...
@@ -50,9 +50,10 @@ Line(value?: {width?: string | number, height?: string | number})
...
@@ -50,9 +50,10 @@ Line(value?: {width?: string | number, height?: string | number})
| strokeWidth | Length | 1 | 否 | 设置线条宽度。 |
| strokeWidth | Length | 1 | 否 | 设置线条宽度。 |
| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 |
| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 |
## 示例
## 示例
### 示例1
```
ts
```
ts
// xxx.ets
// xxx.ets
@
Entry
@
Entry
...
@@ -79,7 +80,15 @@ struct LineExample {
...
@@ -79,7 +80,15 @@ struct LineExample {
.
startPoint
([
0
,
0
])
.
startPoint
([
0
,
0
])
.
endPoint
([
100
,
100
])
.
endPoint
([
100
,
100
])
.
strokeWidth
(
3
)
.
strokeWidth
(
3
)
.
strokeDashArray
([
1
,
3
])
.
strokeDashArray
([
10
,
3
])
.
backgroundColor
(
'
#F5F5F5
'
)
// strokeDashOffset用于定义关联虚线strokeDashArray数组渲染时的偏移
Line
({
width
:
50
,
height
:
50
})
.
startPoint
([
0
,
0
])
.
endPoint
([
100
,
100
])
.
strokeWidth
(
3
)
.
strokeDashArray
([
10
,
3
])
.
strokeDashOffset
(
5
)
.
backgroundColor
(
'
#F5F5F5
'
)
.
backgroundColor
(
'
#F5F5F5
'
)
}
}
}
}
...
@@ -87,3 +96,46 @@ struct LineExample {
...
@@ -87,3 +96,46 @@ struct LineExample {
```
```


### 示例2
```
ts
// xxx.ets
@
Entry
@
Component
struct
LineExample1
{
build
()
{
Row
({
space
:
10
})
{
// 当LineCapStyle值为Butt时
Line
()
.
width
(
100
)
.
height
(
200
)
.
startPoint
([
50
,
50
])
.
endPoint
([
50
,
200
])
.
strokeWidth
(
20
)
.
strokeLineCap
(
LineCapStyle
.
Butt
)
.
backgroundColor
(
'
#F5F5F5
'
).
margin
(
10
)
// 当LineCapStyle值为Round时
Line
()
.
width
(
100
)
.
height
(
200
)
.
startPoint
([
50
,
50
])
.
endPoint
([
50
,
200
])
.
strokeWidth
(
20
)
.
strokeLineCap
(
LineCapStyle
.
Round
)
.
backgroundColor
(
'
#F5F5F5
'
)
// 当LineCapStyle值为Square时
Line
()
.
width
(
100
)
.
height
(
200
)
.
startPoint
([
50
,
50
])
.
endPoint
([
50
,
200
])
.
strokeWidth
(
20
)
.
strokeLineCap
(
LineCapStyle
.
Square
)
.
backgroundColor
(
'
#F5F5F5
'
)
}
}
}
```

\ No newline at end of file
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-path.md
浏览文件 @
683ed007
...
@@ -32,7 +32,7 @@ Path(value?: { width?: number | string; height?: number | string; commands?: str
...
@@ -32,7 +32,7 @@ Path(value?: { width?: number | string; height?: number | string; commands?: str
| commands | string | '' | 否 | 路径绘制的命令字符串,单位为px。像素单位转换方法请参考
[
像素单位转换
](
../../ui/ts-pixel-units.md
)
。 |
| commands | string | '' | 否 | 路径绘制的命令字符串,单位为px。像素单位转换方法请参考
[
像素单位转换
](
../../ui/ts-pixel-units.md
)
。 |
| fill |
[
ResourceColor
](
ts-types.md
)
| Color.Black | 否 | 设置填充区域颜色。 |
| fill |
[
ResourceColor
](
ts-types.md
)
| Color.Black | 否 | 设置填充区域颜色。 |
| fillOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置填充区域透明度。 |
| fillOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置填充区域透明度。 |
| stroke |
[
ResourceColor
](
ts-types.md
)
|
Color.Black
| 否 | 设置线条颜色。 |
| stroke |
[
ResourceColor
](
ts-types.md
)
|
-
| 否 | 设置线条颜色。 |
| strokeDashArray | Array
<
Length
>
| [] | 否 | 设置线条间隙。 |
| strokeDashArray | Array
<
Length
>
| [] | 否 | 设置线条间隙。 |
| strokeDashOffset | number
\|
string | 0 | 否 | 线条绘制起点的偏移量。 |
| strokeDashOffset | number
\|
string | 0 | 否 | 线条绘制起点的偏移量。 |
| strokeLineCap |
[
LineCapStyle
](
ts-appendix-enums.md#linecapstyle
)
| LineCapStyle.Butt | 否 | 设置线条端点绘制样式。 |
| strokeLineCap |
[
LineCapStyle
](
ts-appendix-enums.md#linecapstyle
)
| LineCapStyle.Butt | 否 | 设置线条端点绘制样式。 |
...
...
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polygon.md
浏览文件 @
683ed007
...
@@ -33,14 +33,14 @@ Polygon(value?: {width?: string | number, height?: string | number})
...
@@ -33,14 +33,14 @@ Polygon(value?: {width?: string | number, height?: string | number})
| points | Array
<
Point
>
| [] | 否 | 多边形的顶点坐标列表。 |
| points | Array
<
Point
>
| [] | 否 | 多边形的顶点坐标列表。 |
| fill |
[
ResourceColor
](
ts-types.md
)
| Color.Black | 否 | 设置填充区域颜色。 |
| fill |
[
ResourceColor
](
ts-types.md
)
| Color.Black | 否 | 设置填充区域颜色。 |
| fillOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置填充区域透明度。 |
| fillOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置填充区域透明度。 |
| stroke |
[
ResourceColor
](
ts-types.md
)
|
Color.Black | 否 | 设置线条颜色
。 |
| stroke |
[
ResourceColor
](
ts-types.md
)
|
- | 否 | 设置边框颜色,不设置时,默认没有边框线条
。 |
| strokeDashArray | Array
<
Length
>
| [] | 否 | 设置
线条
间隙。 |
| strokeDashArray | Array
<
Length
>
| [] | 否 | 设置
边框
间隙。 |
| strokeDashOffset | number
\|
string | 0 | 否 |
线条
绘制起点的偏移量。 |
| strokeDashOffset | number
\|
string | 0 | 否 |
边框
绘制起点的偏移量。 |
| strokeLineCap |
[
LineCapStyle
](
ts-appendix-enums.md#linecapstyle
)
| LineCapStyle.Butt | 否 | 设置
线条
端点绘制样式。 |
| strokeLineCap |
[
LineCapStyle
](
ts-appendix-enums.md#linecapstyle
)
| LineCapStyle.Butt | 否 | 设置
边框
端点绘制样式。 |
| strokeLineJoin |
[
LineJoinStyle
](
ts-appendix-enums.md#linejoinstyle
)
| LineJoinStyle.Miter | 否 | 设置
线条
拐角绘制样式。 |
| strokeLineJoin |
[
LineJoinStyle
](
ts-appendix-enums.md#linejoinstyle
)
| LineJoinStyle.Miter | 否 | 设置
边框
拐角绘制样式。 |
| strokeMiterLimit | number
\|
string | 4 | 否 | 设置锐角绘制成斜角的极限值。 |
| strokeMiterLimit | number
\|
string | 4 | 否 | 设置锐角绘制成斜角的极限值。 |
| strokeOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置
线条
透明度。 |
| strokeOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置
边框
透明度。 |
| strokeWidth | Length | 1 | 否 | 设置
线条
宽度。 |
| strokeWidth | Length | 1 | 否 | 设置
边框
宽度。 |
| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 |
| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 |
## Point
## Point
...
...
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polyline.md
浏览文件 @
683ed007
...
@@ -33,7 +33,7 @@ Polyline(value?: {width?: string | number, height?: string | number})
...
@@ -33,7 +33,7 @@ Polyline(value?: {width?: string | number, height?: string | number})
| points | Array
<
Point
>
| [] | 否 | 折线经过坐标点列表。 |
| points | Array
<
Point
>
| [] | 否 | 折线经过坐标点列表。 |
| fill |
[
ResourceColor
](
ts-types.md
)
| Color.Black | 否 | 设置填充区域颜色。 |
| fill |
[
ResourceColor
](
ts-types.md
)
| Color.Black | 否 | 设置填充区域颜色。 |
| fillOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置填充区域透明度。 |
| fillOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置填充区域透明度。 |
| stroke |
[
ResourceColor
](
ts-types.md
)
|
Color.Black
| 否 | 设置线条颜色。 |
| stroke |
[
ResourceColor
](
ts-types.md
)
|
-
| 否 | 设置线条颜色。 |
| strokeDashArray | Array
<
Length
>
| [] | 否 | 设置线条间隙。 |
| strokeDashArray | Array
<
Length
>
| [] | 否 | 设置线条间隙。 |
| strokeDashOffset | number
\|
string | 0 | 否 | 线条绘制起点的偏移量。 |
| strokeDashOffset | number
\|
string | 0 | 否 | 线条绘制起点的偏移量。 |
| strokeLineCap |
[
LineCapStyle
](
ts-appendix-enums.md#linecapstyle
)
| LineCapStyle.Butt | 否 | 设置线条端点绘制样式。 |
| strokeLineCap |
[
LineCapStyle
](
ts-appendix-enums.md#linecapstyle
)
| LineCapStyle.Butt | 否 | 设置线条端点绘制样式。 |
...
...
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md
浏览文件 @
683ed007
...
@@ -19,34 +19,34 @@ Rect(value?: {width?: string | number,height?: string | number,radius?: string |
...
@@ -19,34 +19,34 @@ Rect(value?: {width?: string | number,height?: string | number,radius?: string |
**参数:**
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| width | string
\|
number | 否 | 0 | 宽度。 |
| width | string
\|
number | 否 | 0 | 宽度。 |
| height | string
\|
number | 否 | 0 | 高度。 |
| height | string
\|
number | 否 | 0 | 高度。 |
| radius | string
\|
number
\|
Array
<
string
\|
number
>
| 否 | 0 | 圆角半径,支持分别设置四个角的圆角度数。 |
| radius | string
\|
number
\|
Array
<
string
\|
number
>
| 否 | 0 | 圆角半径,支持分别设置四个角的圆角度数。 |
| radiusWidth | string
\|
number | 否 | 0 | 圆角宽度。 |
| radiusWidth | string
\|
number | 否 | 0 | 圆角宽度。 |
| radiusHeight | string
\|
number | 否 | 0 | 圆角高度。 |
| radiusHeight | string
\|
number | 否 | 0 | 圆角高度。 |
## 属性
## 属性
除支持
[
通用属性
](
ts-universal-attributes-size.md
)
外,还支持以下属性:
除支持
[
通用属性
](
ts-universal-attributes-size.md
)
外,还支持以下属性:
| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| radiusWidth | string
\|
number | 0 | 否 | 圆角的宽度,仅设置宽时宽高一致。 |
| radiusWidth | string
\|
number | 0 | 否 | 圆角的宽度,仅设置宽时宽高一致。 |
| radiusHeight | string
\|
number | 0 | 否 | 圆角的高度,仅设置高时宽高一致。 |
| radiusHeight | string
\|
number | 0 | 否 | 圆角的高度,仅设置高时宽高一致。 |
| radius | string
\|
number
\|
Array
<
string
\|
number
>
| 0 | 否 | 圆角半径大小。 |
| radius | string
\|
number
\|
Array
<
string
\|
number
>
| 0 | 否 | 圆角半径大小。 |
| fill |
[
ResourceColor
](
ts-types.md
)
| Color.Black | 否 | 设置填充区域颜色。 |
| fill |
[
ResourceColor
](
ts-types.md
)
| Color.Black | 否 | 设置填充区域颜色。 |
| fillOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置填充区域透明度。 |
| fillOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置填充区域透明度。 |
| stroke |
[
ResourceColor
](
ts-types.md
)
|
Color.Black | 否 | 设置线条颜色
。 |
| stroke |
[
ResourceColor
](
ts-types.md
)
|
- | 否 | 设置边框颜色,不设置时,默认没有边框
。 |
| strokeDashArray | Array
<
Length
>
| [] | 否 | 设置
线条
间隙。 |
| strokeDashArray | Array
<
Length
>
| [] | 否 | 设置
边框
间隙。 |
| strokeDashOffset | number
\|
string | 0 | 否 |
线条
绘制起点的偏移量。 |
| strokeDashOffset | number
\|
string | 0 | 否 |
边框
绘制起点的偏移量。 |
| strokeLineCap |
[
LineCapStyle
](
ts-appendix-enums.md#linecapstyle
)
| LineCapStyle.Butt | 否 | 设置
线条
端点绘制样式。 |
| strokeLineCap |
[
LineCapStyle
](
ts-appendix-enums.md#linecapstyle
)
| LineCapStyle.Butt | 否 | 设置
边框
端点绘制样式。 |
| strokeLineJoin |
[
LineJoinStyle
](
ts-appendix-enums.md#linejoinstyle
)
| LineJoinStyle.Miter | 否 | 设置
线条
拐角绘制样式。 |
| strokeLineJoin |
[
LineJoinStyle
](
ts-appendix-enums.md#linejoinstyle
)
| LineJoinStyle.Miter | 否 | 设置
边框
拐角绘制样式。 |
| strokeMiterLimit | number
\|
string | 4 | 否 | 设置锐角绘制成斜角的极限值。 |
| strokeMiterLimit | number
\|
string | 4 | 否 | 设置锐角绘制成斜角的极限值。 |
| strokeOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置
线条
透明度。 |
| strokeOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置
边框
透明度。 |
| strokeWidth | Length | 1 | 否 | 设置
线条
宽度。 |
| strokeWidth | Length | 1 | 否 | 设置
边框
宽度。 |
| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 |
| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 |
...
...
zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-shape.md
浏览文件 @
683ed007
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
## 子组件
## 子组件
可以包含
子组件。
包含
[
Rect
](
ts-drawing-components-rect.md
)
、
[
Path
](
ts-drawing-components-path.md
)
、
[
Circle
](
ts-drawing-components-circle.md
)
、
[
Ellipse
](
ts-drawing-components-ellipse.md
)
、
[
Polyline
](
ts-drawing-components-polyline.md
)
、
[
Polygon
](
ts-drawing-components-polygon.md
)
、
[
Image
](
ts-basic-components-image.md
)
、
[
Text
](
ts-basic-components-text.md
)
、
[
Column
](
ts-container-column.md
)
、
[
Row
](
ts-container-row.md
)
子组件。
## 接口
## 接口
...
@@ -37,14 +37,14 @@ Shape(value?: PixelMap)
...
@@ -37,14 +37,14 @@ Shape(value?: PixelMap)
| viewPort | {
<br/>
x?:
number
\|
string,
<br/>
y?:
number
\|
string,
<br/>
width?:
number
\|
string,
<br/>
height?:
number
\|
string
<br/>
} | { x:0, y:0, width:0, height:0 } | 否 | 形状的视口。 |
| viewPort | {
<br/>
x?:
number
\|
string,
<br/>
y?:
number
\|
string,
<br/>
width?:
number
\|
string,
<br/>
height?:
number
\|
string
<br/>
} | { x:0, y:0, width:0, height:0 } | 否 | 形状的视口。 |
| fill |
[
ResourceColor
](
ts-types.md
)
| Color.Black | 否 | 设置填充区域颜色。 |
| fill |
[
ResourceColor
](
ts-types.md
)
| Color.Black | 否 | 设置填充区域颜色。 |
| fillOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置填充区域透明度。 |
| fillOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置填充区域透明度。 |
| stroke |
[
ResourceColor
](
ts-types.md
)
|
Color.Black | 否 | 设置线条颜色
。 |
| stroke |
[
ResourceColor
](
ts-types.md
)
|
- | 否 | 设置边框颜色,不设置时,默认没有边框线条
。 |
| strokeDashArray | Array
<
Length
>
| [] | 否 | 设置
线条
间隙。 |
| strokeDashArray | Array
<
Length
>
| [] | 否 | 设置
边框
间隙。 |
| strokeDashOffset | number
\|
string | 0 | 否 |
线条
绘制起点的偏移量。 |
| strokeDashOffset | number
\|
string | 0 | 否 |
边框
绘制起点的偏移量。 |
| strokeLineCap |
[
LineCapStyle
](
ts-appendix-enums.md#linecapstyle
)
| LineCapStyle.Butt | 否 | 设置
线条
端点绘制样式。 |
| strokeLineCap |
[
LineCapStyle
](
ts-appendix-enums.md#linecapstyle
)
| LineCapStyle.Butt | 否 | 设置
边框
端点绘制样式。 |
| strokeLineJoin |
[
LineJoinStyle
](
ts-appendix-enums.md#linejoinstyle
)
| LineJoinStyle.Miter | 否 | 设置
线条
拐角绘制样式。 |
| strokeLineJoin |
[
LineJoinStyle
](
ts-appendix-enums.md#linejoinstyle
)
| LineJoinStyle.Miter | 否 | 设置
边框
拐角绘制样式。 |
| strokeMiterLimit | number
\|
string | 4 | 否 | 设置锐角绘制成斜角的极限值。 |
| strokeMiterLimit | number
\|
string | 4 | 否 | 设置锐角绘制成斜角的极限值。 |
| strokeOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置
线条
透明度。 |
| strokeOpacity | number
\|
string
\|
[
Resource
](
ts-types.md#resource类型
)
| 1 | 否 | 设置
边框
透明度。 |
| strokeWidth | number
\|
string | 1 | 否 | 设置
线条
宽度。 |
| strokeWidth | number
\|
string | 1 | 否 | 设置
边框
宽度。 |
| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 |
| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 |
| mesh
<sup>
8+
</sup>
| Array
<
number
>
,number,number | [],0,0 | 否 | 设置mesh效果。第一个参数为长度(column + 1)
* (row + 1)*
2的数组,它记录了扭曲后的位图各个顶点位置,第二个参数为mesh矩阵列数column,第三个参数为mesh矩阵行数row。 |
| mesh
<sup>
8+
</sup>
| Array
<
number
>
,number,number | [],0,0 | 否 | 设置mesh效果。第一个参数为长度(column + 1)
* (row + 1)*
2的数组,它记录了扭曲后的位图各个顶点位置,第二个参数为mesh矩阵列数column,第三个参数为mesh矩阵行数row。 |
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录