Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
ed8a9201
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看板
提交
ed8a9201
编写于
1月 28, 2022
作者:
Y
yaoyuchi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
edit canvas doc
Signed-off-by:
N
yaoyuchi
<
yaoyuchi@huawei.com
>
上级
758b703f
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
143 addition
and
159 deletion
+143
-159
zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md
...ion-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md
+64
-77
zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md
...ion-dev/reference/arkui-ts/ts-components-canvas-canvas.md
+1
-1
zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvasgradient.md
...reference/arkui-ts/ts-components-canvas-canvasgradient.md
+4
-5
zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-imagebitmap.md
...ev/reference/arkui-ts/ts-components-canvas-imagebitmap.md
+1
-1
zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-path2d.md
...ion-dev/reference/arkui-ts/ts-components-canvas-path2d.md
+12
-12
zh-cn/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md
...eference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md
+61
-63
未找到文件。
zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md
浏览文件 @
ed8a9201
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md
浏览文件 @
ed8a9201
...
...
@@ -78,7 +78,7 @@ Canvas\(context: CanvasRenderingContext2D\)
@Entry
@Component
struct CanvasExample {
private settings: RenderingContextSettings = new RenderingContextSettings(true
,true
)
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
build() {
...
...
zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvasgradient.md
浏览文件 @
ed8a9201
...
...
@@ -56,9 +56,8 @@ addColorStop\(offset: number, color: string\): void
@Entry
@Component
struct Page45 {
private settings: RenderingContextSettings = new RenderingContextSettings(true
,true
)
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private gra:CanvasGradient = new CanvasGradient()
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
...
...
@@ -68,9 +67,9 @@ addColorStop\(offset: number, color: string\): void
.backgroundColor('#ffff00')
.onReady(() =>{
var grad = this.context.createLinearGradient(50,0, 300,100)
this.gra
.addColorStop(0.0, 'red')
this.gra
.addColorStop(0.5, 'white')
this.gra
.addColorStop(1.0, 'green')
grad
.addColorStop(0.0, 'red')
grad
.addColorStop(0.5, 'white')
grad
.addColorStop(1.0, 'green')
this.context.fillStyle = grad
this.context.fillRect(0, 0, 500, 500)
})
...
...
zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-imagebitmap.md
浏览文件 @
ed8a9201
...
...
@@ -83,7 +83,7 @@ ImageBitmap\(src: string\)
@Entry
@Component
struct DrawImageExample {
private settings:RenderingContextSettings = new RenderingContextSettings(true
,true
)
private settings:RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private img:ImageBitmap = new ImageBitmap("common/images/example.jpg")
...
...
zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-path2d.md
浏览文件 @
ed8a9201
...
...
@@ -45,7 +45,7 @@ addPath\(path: Object\): void
@Entry
@Component
struct AddPath {
private settings: RenderingContextSettings = new RenderingContextSettings(true
,true
)
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private path2Da: Path2D = new Path2D("M250 150 L150 350 L350 350 Z")
...
...
@@ -83,7 +83,7 @@ closePath\(\): void
@Entry
@Component
struct ClosePath {
private settings: RenderingContextSettings = new RenderingContextSettings(true
,true
)
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private path2Db: Path2D = new Path2D()
...
...
@@ -161,7 +161,7 @@ moveTo\(x: number, y: number\): void
@Entry
@Component
struct MoveTo {
private settings: RenderingContextSettings = new RenderingContextSettings(true
,true
)
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private path2Db: Path2D = new Path2D()
...
...
@@ -239,7 +239,7 @@ lineTo\(x: number, y: number\): void
@Entry
@Component
struct LineTo {
private settings: RenderingContextSettings = new RenderingContextSettings(true
,true
)
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private path2Db: Path2D = new Path2D()
...
...
@@ -363,7 +363,7 @@ bezierCurveTo\(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number
@Entry
@Component
struct BezierCurveTo {
private settings: RenderingContextSettings = new RenderingContextSettings(true
,true
)
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private path2Db: Path2D = new Path2D()
...
...
@@ -460,7 +460,7 @@ quadraticCurveTo\(cpx: number, cpy: number, x: number ,y: number\): void
@Entry
@Component
struct QuadraticCurveTo {
private settings: RenderingContextSettings = new RenderingContextSettings(true
,true
)
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private path2Db: Path2D = new Path2D()
...
...
@@ -580,7 +580,7 @@ arc\(x: number, y: number, radius: number, startAngle: number, endAngle: number,
@Entry
@Component
struct Arc {
private settings: RenderingContextSettings = new RenderingContextSettings(true
,true
)
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private path2Db: Path2D = new Path2D()
...
...
@@ -687,7 +687,7 @@ arcTo\(x1: number, y1: number, x2: number, y2: number, radius: number\): void
@Entry
@Component
struct ArcTo {
private settings: RenderingContextSettings = new RenderingContextSettings(true
,true
)
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private path2Db: Path2D = new Path2D()
...
...
@@ -827,8 +827,8 @@ ellipse\(x: number, y: number, radiusX: number, radiusY: number, rotation: numbe
```
@Entry
@Component
struct
Ellips
e {
private settings: RenderingContextSettings = new RenderingContextSettings(true
,true
)
struct
CanvasExampl
e {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private path2Db: Path2D = new Path2D()
...
...
@@ -924,8 +924,8 @@ rect\(x: number, y: number, width: number, height: number\): void
```
@Entry
@Component
struct
Rect
{
private settings: RenderingContextSettings = new RenderingContextSettings(true
,true
)
struct
CanvasExample
{
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private path2Db: Path2D = new Path2D()
...
...
zh-cn/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md
浏览文件 @
ed8a9201
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录