HarmonyOS 本地视频预览是否可以进行镜像处理

HarmonyOS
2024-12-20 16:13:46
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
superinsect

参考:

@State screenWidth: number = 0
aboutToAppear() {
  display.getAllDisplays((err, data) => {
    this.screenWidth = px2vp(data[0].width)
  })
}
XComponent({
  id: '',
  type: 'surface',
  libraryname: '',
  controller: this.mXComponentController
})
  .rotate({ y: this.screenWidth/2, angle: 180 })
  .onLoad(() => {
    // 设置Surface宽高(1920*1080),预览尺寸设置参考前面 previewProfilesArray 获取的当前设备所支持的预览分辨率大小去设置
    // 预览流与录像输出流的分辨率的宽高比要保持一致
    this.mXComponentController.setXComponentSurfaceSize({ surfaceWidth: 1920, surfaceHeight: 1080 });
    // 获取Surface ID
    this.surfaceId = this.mXComponentController.getXComponentSurfaceId();
  })
  .width('1920px')
  .height('1080px')
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
分享
微博
QQ
微信
回复
2024-12-20 17:12:20
相关问题
卡片能否通过预览进行预览
1048浏览 • 1回复 待解决
如何使用预览接口进行文件预览
909浏览 • 1回复 待解决
HarmonyOS 下载到本地文件的预览问题
537浏览 • 1回复 待解决