2013-11-15 127 views
0

我可能會錯過一些東西,但當我嘗試使用:System.Windows.Forms.Screen.PrimaryScreen.Bounds.WidthgraphicsDevice.PresentationParameters.BackBufferWidth;時,我無法使用這些。屏幕調整C#2010

我可能失去了一些東西對他們的呼籲內容裝載機:

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using Microsoft.Xna.Framework; 
using Microsoft.Xna.Framework.Audio; 
using Microsoft.Xna.Framework.Content; 
using Microsoft.Xna.Framework.GamerServices; 
using Microsoft.Xna.Framework.Graphics; 
using Microsoft.Xna.Framework.Input; 
using Microsoft.Xna.Framework.Media; 
using Microsoft.Xna.Framework.Storage; 
using Microsoft.Xna.Framework.Content; 

回答

1

,你可以用GraphicsDeviceManager改變它。

public Game1() 
    { 
     graphics = new GraphicsDeviceManager(this); 
     graphics.PreferredBackBufferHeight = 1080; //Height 
     graphics.PreferredBackBufferWidth = 1920; //Width 
     graphics.IsFullScreen = true; //Fullscreen On/off 
     graphics.ApplyChanges(); //Execute Changes!!!IMPORTANT!!! 
     //if you want use/change the PresentationParameters.BackBufferWidth, you could do it with the GraphicsDevice which could be found in the GraphicsDeviceManager Class 
     graphics.GraphicsDevice.PresentationParameters.BackBufferWidth; 
    } 
+0

謝謝您的信息,先生您可以告訴我更多關於如何使圖像重新調整大小以適應全屏? http://stackoverflow.com/questions/20001894/transferring-texture-across-classes –

+0

實際沒關係preferredbackbuffer的高度和寬度正在爲我做... –