所有,我想在Windows Phone中使用XNA显示全屏摄像头(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);
}
答案 0 :(得分:0)
好的,我明白了
Microsoft.Xna.Framework.Rectangle rec = new Microsoft.Xna.Framework.Rectangle(0, 0, (int)ActualWidth, (int)ActualHeight);
spriteBatch.Draw(texture,rec,Microsoft.Xna.Framework.Color.White);