ViewMinder方向与Windows Phone 7芒果PhotoCamera

我正在使用PhotoCamera控件与 Windows Phone 7芒果Beta 2开发工具.

相机控件的“ViewFinder”是一个填充有VideoBrush的矩形对象,如下例所示:

http://msdn.microsoft.com/en-us/library/hh202956%28v=VS.92%29.aspx

我的问题是,当我在手机上运行应用程序时,ViewFinder图像总是逆时针旋转90度.无论手机如何定位,都是如此.

有谁知道如何正确定向ViewFinder?

是的,方向是您需要使用相对变换管理的东西:
<!--Camera viewfinder >-->
<Rectangle Grid.Row="1"
            x:Name="preview">
  <Rectangle.Fill>
    <VideoBrush x:Name="previewBrush">
      <VideoBrush.RelativeTransform>
        <CompositeTransform x:Name="previewTransform"
                            CenterX=".5"
                            CenterY=".5" />
      </VideoBrush.RelativeTransform>
    </VideoBrush>
  </Rectangle.Fill>
</Rectangle>

然后,您可以使用PhotoCamera类确定如何旋转它:

double cameraRotation = theCamera.Orientation;

// Use the orientation to determine how to transform 
// the camera preview
previewTransform.Rotation = theCamera.Orientation + 90.0; // Landscape?

HTH

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...