[英]Xamarin android Camera2 - image preview getting stretched on 18:9 aspect ratio devices
On running the Camera2Basic in 18:9 screen aspect ratio devices, the image preview and captured image is getting stretched.在 18:9 屏幕纵横比设备中运行 Camera2Basic 时,图像预览和捕获的图像会被拉伸。
Device camera and camera2 basic side by side:设备相机和 camera2 基本并排:
How would i resolve this while keeping the preview ratio as 1.33?在将预览比率保持为 1.33 的同时我将如何解决这个问题? I tried setting the height of the texture preview by keeping the ratio 1.33 as constant and scaling the height with width as 1080.
我尝试通过保持比率 1.33 不变并将高度与宽度缩放为 1080 来设置纹理预览的高度。
var ratio = 1.33;
var scaledWidth = mPreviewSize.Height;
var scaledHeight = (int)Java.Lang.Math.Round(scaledWidth * ratio);
mTextureView.SetAspectRatio(scaledWidth, scaledHeight);
But result is still the same.但结果还是一样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.