本文介绍了CameraX PreviewView屏幕截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将CameraX预览从PreviewView转换为位图.类似于textureView.bitmap
I want to convert CameraX preview to bitmap from previewView. Something similar to textureView.bitmap
我已经尝试过使用textureview进行操作,并且它可以正常工作,我可以拍摄cameraview的屏幕截图,但是相机是拉伸的.
I have tried it with a textureview and it works perferctly, i can take a screenshot of the cameraview but the camera is stretched.
推荐答案
PreviewView现在通过调用PreviewView.getBitmap()支持屏幕截图.请参阅: https://developer.android.com/reference/androidx/camera/view/PreviewView#getBitmap()
PreviewView now supports screenshot by calling PreviewView.getBitmap(). See: https://developer.android.com/reference/androidx/camera/view/PreviewView#getBitmap()
这篇关于CameraX PreviewView屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!