0

全部,我想用 XNA 在 Windows Phone 中显示全屏相机(Microsoft.Devices.PhotoCamera),如下面的代码所示,我试图改变 screenpos 和 origin 的值,但是没有用,我的有什么问题代码?谢谢

 if (CameraTexture != null)
        {
            Vector2 origin = new Vector2(CameraTexture.Width / 2, CameraTexture.Height / 2);
            Vector2 screenpos = new Vector2(240, 400);
            spriteBatch.Draw(CameraTexture, screenpos, null, Microsoft.Xna.Framework.Color.White, (float)Math.PI / 2,
           origin, 1.0f, SpriteEffects.None, 0f);
        }
4

1 回答 1

0

好,我知道了

Microsoft.Xna.Framework.Rectangle rec = new Microsoft.Xna.Framework.Rectangle(0, 0, (int)ActualWidth, (int)ActualHeight);

spriteBatch.Draw(纹理,rec,Microsoft.Xna.Framework.Color.White);

于 2012-07-24T07:27:38.867 回答