原图

图片水平(左右)翻转

import matrix4 from '@ohos.matrix4'
@Entry
@Component
struct FishGamePage {
private matrix1 = matrix4.identity().rotate({ x: 0, y: 1, z: 0, angle: 180 })
@Styles transformStyle(){
.transform(this.matrix1)
}
build() {
Image($r('app.media.xx'))
.width(200)
.height(100)
.transformStyle()
}
}
图片垂直(上下)翻转

import matrix4 from '@ohos.matrix4'
@Entry
@Component
struct FishGamePage {
private matrix1 = matrix4.identity().rotate({ x: 1, y: 0, z: 0, angle: 180 })
@Styles transformStyle(){
.transform(this.matrix1)
}
build() {
Image($r('app.media.xx'))
.width(200)
.height(100)
.transformStyle()
}
}
1796

被折叠的 条评论
为什么被折叠?



