gpt4 book ai didi

c# - Windows Phone 8 中的设备方向

转载 作者:太空狗 更新时间:2023-10-29 23:24:34 25 4
gpt4 key购买 nike

我想在使用 PhotoCaptureDevice 选项拍照时根据 Windows Phone 8 中的设备方向旋转图像。

当设备方向为

LandscapeLeft  - Image to be rotated to -90
LandscapeRight - Image to be rotated to 90

但在 Windows Phone 8 中没有找到设备方向的选项。你能请任何人帮助我吗?

最佳答案

您可以使用加速度传感器读数,然后按如下方式获取 atan2:

angle = Math.Atan2(-x,y) * 180.0 / Math.PI;

其中“角度”是相对于默认纵向方向的设备方向。

关于c# - Windows Phone 8 中的设备方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13740443/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com