Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
70017adf
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
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看板
提交
70017adf
编写于
5月 04, 2023
作者:
L
limeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the problem for review
Signed-off-by:
N
limeng
<
limeng208@huawei.com
>
上级
9bb6cf61
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
33 deletion
+33
-33
zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvaspattern.md
.../reference/arkui-ts/ts-components-canvas-canvaspattern.md
+2
-2
zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-matrix2d.md
...n-dev/reference/arkui-ts/ts-components-canvas-matrix2d.md
+31
-31
未找到文件。
zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvaspattern.md
浏览文件 @
70017adf
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
### setTransform
### setTransform
setTransform(transform?: Matrix2D): void
;
setTransform(transform?: Matrix2D): void
使用Matrix2D对象作为参数、对当前CanvasPattern进行矩阵变换。
使用Matrix2D对象作为参数、对当前CanvasPattern进行矩阵变换。
...
@@ -24,7 +24,7 @@ setTransform(transform?: Matrix2D): void;
...
@@ -24,7 +24,7 @@ setTransform(transform?: Matrix2D): void;
**示例:**
**示例:**
```
t
ypescript
```
t
s
// xxx.ets
// xxx.ets
@
Entry
@
Entry
@
Component
@
Component
...
...
zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-matrix2d.md
浏览文件 @
70017adf
...
@@ -25,11 +25,11 @@ Matrix2D()
...
@@ -25,11 +25,11 @@ Matrix2D()
> **说明:**
> **说明:**
>
>
> 可使用[px2vp](
https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/
ts-pixel-units.md)接口进行单位转换。
> 可使用[px2vp](ts-pixel-units.md)接口进行单位转换。
### scaleX
### scaleX
```
t
ypescript
```
t
s
// xxx.ets
// xxx.ets
@
Entry
@
Entry
@
Component
@
Component
...
@@ -64,7 +64,7 @@ struct Matrix2DScaleX {
...
@@ -64,7 +64,7 @@ struct Matrix2DScaleX {
### scaleY
### scaleY
```
t
ypescript
```
t
s
// xxx.ets
// xxx.ets
@
Entry
@
Entry
@
Component
@
Component
...
@@ -99,7 +99,7 @@ struct Matrix2DScaleY {
...
@@ -99,7 +99,7 @@ struct Matrix2DScaleY {
### rotateX
### rotateX
```
t
ypescript
```
t
s
// xxx.ets
// xxx.ets
@
Entry
@
Entry
@
Component
@
Component
...
@@ -134,7 +134,7 @@ struct Matrix2DRotateX {
...
@@ -134,7 +134,7 @@ struct Matrix2DRotateX {
### rotateY
### rotateY
```
t
ypescript
```
t
s
// xxx.ets
// xxx.ets
@
Entry
@
Entry
@
Component
@
Component
...
@@ -169,7 +169,7 @@ struct Matrix2DRotateY {
...
@@ -169,7 +169,7 @@ struct Matrix2DRotateY {
### translateX
### translateX
```
t
ypescript
```
t
s
// xxx.ets
// xxx.ets
@
Entry
@
Entry
@
Component
@
Component
...
@@ -204,7 +204,7 @@ struct Matrix2DTranslateX {
...
@@ -204,7 +204,7 @@ struct Matrix2DTranslateX {
### translateY
### translateY
```
t
ypescript
```
t
s
// xxx.ets
// xxx.ets
@
Entry
@
Entry
@
Component
@
Component
...
@@ -241,7 +241,7 @@ struct Matrix2DTranslateY {
...
@@ -241,7 +241,7 @@ struct Matrix2DTranslateY {
### identity
### identity
identity(): Matrix2D
;
identity(): Matrix2D
创建一个单位矩阵。
创建一个单位矩阵。
...
@@ -255,7 +255,7 @@ identity(): Matrix2D;
...
@@ -255,7 +255,7 @@ identity(): Matrix2D;
**示例:**
**示例:**
```
t
ypescript
```
t
s
// xxx.ets
// xxx.ets
@
Entry
@
Entry
@
Component
@
Component
...
@@ -277,7 +277,7 @@ struct Matrix2DIdentity {
...
@@ -277,7 +277,7 @@ struct Matrix2DIdentity {
Button
(
"
matrix identity
"
)
Button
(
"
matrix identity
"
)
.
onClick
(()
=>
{
.
onClick
(()
=>
{
var
matrix
:
Matrix2D
=
new
Matrix2D
()
var
matrix
:
Matrix2D
=
new
Matrix2D
()
matrix
.
identity
()
matrix
=
matrix
.
identity
()
this
.
printMatrix
(
this
.
message
,
matrix
)
this
.
printMatrix
(
this
.
message
,
matrix
)
})
})
}
}
...
@@ -290,7 +290,7 @@ struct Matrix2DIdentity {
...
@@ -290,7 +290,7 @@ struct Matrix2DIdentity {
### invert
### invert
invert(): Matrix2D
;
invert(): Matrix2D
得到当前矩阵的逆矩阵。
得到当前矩阵的逆矩阵。
...
@@ -304,7 +304,7 @@ invert(): Matrix2D;
...
@@ -304,7 +304,7 @@ invert(): Matrix2D;
**示例:**
**示例:**
```
t
ypescript
```
t
s
// xxx.ets
// xxx.ets
@
Entry
@
Entry
@
Component
@
Component
...
@@ -314,8 +314,8 @@ struct Matrix2DInvert {
...
@@ -314,8 +314,8 @@ struct Matrix2DInvert {
printMatrix
(
title
,
matrix
)
{
printMatrix
(
title
,
matrix
)
{
console
.
log
(
title
)
console
.
log
(
title
)
console
.
log
(
"
Matrix [scaleX =
"
+
matrix
.
scaleX
+
"
, scaleY =
"
+
matrix
.
scaleY
+
console
.
log
(
"
Matrix [scaleX =
"
+
matrix
.
scaleX
+
"
, scaleY =
"
+
matrix
.
scaleY
+
"
, rotateX =
"
+
matrix
.
rotateX
+
"
, rotateY =
"
+
matrix
.
rotateY
+
"
, rotateX =
"
+
matrix
.
rotateX
+
"
, rotateY =
"
+
matrix
.
rotateY
+
"
, translateX =
"
+
matrix
.
translateX
+
"
, translateY =
"
+
matrix
.
translateY
+
"
]
"
)
"
, translateX =
"
+
matrix
.
translateX
+
"
, translateY =
"
+
matrix
.
translateY
+
"
]
"
)
}
}
build
()
{
build
()
{
Row
()
{
Row
()
{
...
@@ -345,7 +345,7 @@ struct Matrix2DInvert {
...
@@ -345,7 +345,7 @@ struct Matrix2DInvert {
### multiply
### multiply
multiply(other?: Matrix2D): Matrix2D
;
multiply(other?: Matrix2D): Matrix2D
当前矩阵与目标矩阵相乘。
当前矩阵与目标矩阵相乘。
...
@@ -367,7 +367,7 @@ multiply(other?: Matrix2D): Matrix2D;
...
@@ -367,7 +367,7 @@ multiply(other?: Matrix2D): Matrix2D;
**示例:**
**示例:**
```
t
ypescript
```
t
s
// xxx.ets
// xxx.ets
@
Entry
@
Entry
@
Component
@
Component
...
@@ -377,8 +377,8 @@ struct Matrix2DMultiply {
...
@@ -377,8 +377,8 @@ struct Matrix2DMultiply {
printMatrix
(
title
,
matrix
)
{
printMatrix
(
title
,
matrix
)
{
console
.
log
(
title
)
console
.
log
(
title
)
console
.
log
(
"
Matrix [scaleX =
"
+
matrix
.
scaleX
+
"
, scaleY =
"
+
matrix
.
scaleY
+
console
.
log
(
"
Matrix [scaleX =
"
+
matrix
.
scaleX
+
"
, scaleY =
"
+
matrix
.
scaleY
+
"
, rotateX =
"
+
matrix
.
rotateX
+
"
, rotateY =
"
+
matrix
.
rotateY
+
"
, rotateX =
"
+
matrix
.
rotateX
+
"
, rotateY =
"
+
matrix
.
rotateY
+
"
, translateX =
"
+
matrix
.
translateX
+
"
, translateY =
"
+
matrix
.
translateY
+
"
]
"
)
"
, translateX =
"
+
matrix
.
translateX
+
"
, translateY =
"
+
matrix
.
translateY
+
"
]
"
)
}
}
build
()
{
build
()
{
Row
()
{
Row
()
{
...
@@ -415,11 +415,11 @@ struct Matrix2DMultiply {
...
@@ -415,11 +415,11 @@ struct Matrix2DMultiply {
### rotate<sup>10+</sup>
### rotate<sup>10+</sup>
rotate(degree: number, rx?: number, ry?: number): Matrix2D
;
rotate(degree: number, rx?: number, ry?: number): Matrix2D
以旋转点为中心、对当前矩阵进行右乘旋转运算。
以旋转点为中心、对当前矩阵进行右乘旋转运算。
从API version
9
开始,该接口支持在ArkTS卡片中使用。
从API version
10
开始,该接口支持在ArkTS卡片中使用。
**参数:**
**参数:**
...
@@ -437,7 +437,7 @@ rotate(degree: number, rx?: number, ry?: number): Matrix2D;
...
@@ -437,7 +437,7 @@ rotate(degree: number, rx?: number, ry?: number): Matrix2D;
**示例:**
**示例:**
```
t
ypescript
```
t
s
// xxx.ets
// xxx.ets
@
Entry
@
Entry
@
Component
@
Component
...
@@ -447,8 +447,8 @@ struct Matrix2DRotate {
...
@@ -447,8 +447,8 @@ struct Matrix2DRotate {
printMatrix
(
title
,
matrix
)
{
printMatrix
(
title
,
matrix
)
{
console
.
log
(
title
)
console
.
log
(
title
)
console
.
log
(
"
Matrix [scaleX =
"
+
matrix
.
scaleX
+
"
, scaleY =
"
+
matrix
.
scaleY
+
console
.
log
(
"
Matrix [scaleX =
"
+
matrix
.
scaleX
+
"
, scaleY =
"
+
matrix
.
scaleY
+
"
, rotateX =
"
+
matrix
.
rotateX
+
"
, rotateY =
"
+
matrix
.
rotateY
+
"
, rotateX =
"
+
matrix
.
rotateX
+
"
, rotateY =
"
+
matrix
.
rotateY
+
"
, translateX =
"
+
matrix
.
translateX
+
"
, translateY =
"
+
matrix
.
translateY
+
"
]
"
)
"
, translateX =
"
+
matrix
.
translateX
+
"
, translateY =
"
+
matrix
.
translateY
+
"
]
"
)
}
}
build
()
{
build
()
{
Row
()
{
Row
()
{
...
@@ -478,7 +478,7 @@ struct Matrix2DRotate {
...
@@ -478,7 +478,7 @@ struct Matrix2DRotate {
### translate
### translate
translate(tx?: number, ty?: number): Matrix2D
;
translate(tx?: number, ty?: number): Matrix2D
对当前矩阵进行左乘平移运算。
对当前矩阵进行左乘平移运算。
...
@@ -499,7 +499,7 @@ translate(tx?: number, ty?: number): Matrix2D;
...
@@ -499,7 +499,7 @@ translate(tx?: number, ty?: number): Matrix2D;
**示例:**
**示例:**
```
t
ypescript
```
t
s
// xxx.ets
// xxx.ets
@
Entry
@
Entry
@
Component
@
Component
...
@@ -509,8 +509,8 @@ struct Matrix2DTranslate {
...
@@ -509,8 +509,8 @@ struct Matrix2DTranslate {
printMatrix
(
title
,
matrix
)
{
printMatrix
(
title
,
matrix
)
{
console
.
log
(
title
)
console
.
log
(
title
)
console
.
log
(
"
Matrix [scaleX =
"
+
matrix
.
scaleX
+
"
, scaleY =
"
+
matrix
.
scaleY
+
console
.
log
(
"
Matrix [scaleX =
"
+
matrix
.
scaleX
+
"
, scaleY =
"
+
matrix
.
scaleY
+
"
, rotateX =
"
+
matrix
.
rotateX
+
"
, rotateY =
"
+
matrix
.
rotateY
+
"
, rotateX =
"
+
matrix
.
rotateX
+
"
, rotateY =
"
+
matrix
.
rotateY
+
"
, translateX =
"
+
matrix
.
translateX
+
"
, translateY =
"
+
matrix
.
translateY
+
"
]
"
)
"
, translateX =
"
+
matrix
.
translateX
+
"
, translateY =
"
+
matrix
.
translateY
+
"
]
"
)
}
}
build
()
{
build
()
{
Row
()
{
Row
()
{
...
@@ -540,7 +540,7 @@ struct Matrix2DTranslate {
...
@@ -540,7 +540,7 @@ struct Matrix2DTranslate {
### scale
### scale
scale(sx?: number, sy?: number): Matrix2D
;
scale(sx?: number, sy?: number): Matrix2D
对当前矩阵进行右乘缩放运算。
对当前矩阵进行右乘缩放运算。
...
@@ -561,7 +561,7 @@ scale(sx?: number, sy?: number): Matrix2D;
...
@@ -561,7 +561,7 @@ scale(sx?: number, sy?: number): Matrix2D;
**示例:**
**示例:**
```
t
ypescript
```
t
s
// xxx.ets
// xxx.ets
@
Entry
@
Entry
@
Component
@
Component
...
@@ -571,8 +571,8 @@ struct Matrix2DScale {
...
@@ -571,8 +571,8 @@ struct Matrix2DScale {
printMatrix
(
title
,
matrix
)
{
printMatrix
(
title
,
matrix
)
{
console
.
log
(
title
)
console
.
log
(
title
)
console
.
log
(
"
Matrix [scaleX =
"
+
matrix
.
scaleX
+
"
, scaleY =
"
+
matrix
.
scaleY
+
console
.
log
(
"
Matrix [scaleX =
"
+
matrix
.
scaleX
+
"
, scaleY =
"
+
matrix
.
scaleY
+
"
, rotateX =
"
+
matrix
.
rotateX
+
"
, rotateY =
"
+
matrix
.
rotateY
+
"
, rotateX =
"
+
matrix
.
rotateX
+
"
, rotateY =
"
+
matrix
.
rotateY
+
"
, translateX =
"
+
matrix
.
translateX
+
"
, translateY =
"
+
matrix
.
translateY
+
"
]
"
)
"
, translateX =
"
+
matrix
.
translateX
+
"
, translateY =
"
+
matrix
.
translateY
+
"
]
"
)
}
}
build
()
{
build
()
{
Row
()
{
Row
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录