使用一下代码 app 截图黑屏,这是什么问题呀
/** 截屏 */
const screenshot = () => {
// #ifdef APP-PLUS
let bitmap = new plus.nativeObj.Bitmap() // 图片对象
const wvs = plus.webview.currentWebview()
wvs.draw(bitmap, async (res) => {
console.log('=== ', res)
// 保存图片
const savePath = '_downloads/km-screeenshot.png'
bitmap.save(savePath, { overwrite: true }, () => {
tmpImageSrc.value = savePath
saveImage(savePath)
}, screenshotError)
}, screenshotError, {
bit: 'RGB565',
check: true,
clip: {top:'0px',left:'0px',width:'100px',height:'100px'}
})
// #endif
}
空晓天 (作者)
谢谢,我去试试哈
2023-08-18 17:25
喜欢技术的前端
回复 2***@qq.com: 不客气,你的是vue3 得改改
2023-08-18 17:28
亿企查
如果需要长截图怎么办?这个方案只能截取到可视内容
2024-07-02 11:25