harmony 鸿蒙ArkUI Subsystem Changelog
ArkUI Subsystem Changelog
cl.arkui.1 setLineDash Implementation Change
Changed the unit of the number parameter in the setLineDash API from px to vp.
Example
@Entry
@Component
struct SetLineDash {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Canvas(this.context)
.width('100%')
.height('100%')
.backgroundColor('#ffff00')
.onReady(() =>{
let ctx = this.context
ctx.lineWidth = 5
ctx.arc(100, 75, 50, 0, 6.28)
ctx.setLineDash([10,20])
ctx.stroke();
})
Image('image/SetLineDash.png')
.objectFit(ImageFit.Contain)
}
.width('100%')
.height('100%')
}
}
API version 9: The unit of the number parameter in the setLineDash API is px.
API version 10 and later: The unit of the number parameter in the setLineDash API is vp.
Change Impact
The drawing effect of the setLineDash API in API version 9 or earlier is different from that in API version 10 or later.
你可能感兴趣的鸿蒙文章
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦