Jump to content
  • Advertisement
Sign in to follow this  
pimple

C# full screen/change res...

This topic is 5396 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello... how would i go about setting my application (C#) to full screen mode and have it run at a certain resolution (640x480)? i'm just using Borland's C# Builder (windows forms)... thanks!

Share this post


Link to post
Share on other sites
Advertisement
To change the physical screen res, you are going to have to tap into the Win32 api. If it is just for graphics and a basic interface you can use directX and create a full screen device, then set the res on that.

Share this post


Link to post
Share on other sites
Quote:
Original post by pimple
hello... how would i go about setting my application (C#) to full screen mode and have it run at a certain resolution (640x480)?
i'm just using Borland's C# Builder (windows forms)... thanks!


I don't have any clue about maximizing C# WinForms (or whatever they're call) in C#, but I'm capable of showing the monitor change to a different resolution using Win32 API:

DEVMODE dm;

dm.dmSize = sizeof(DEVMODE);
dm.dmBitsPerPel = 32;
dm.dmPelsWidth = 640;
dm.dmPelsHeight = 480;
dm.dmDisplayFrequency = 85;
dm.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY;
ChangeDisplaySettings(&dm, CDS_FULLSCREEN);



You don't have to set all the flags, but I do it because it will run 60 Hz otherwise (on my monitors anyway)...

And to return to normal screen settings (before the :
ChangeDisplaySettings(NULL, 0);

To make the borders on the window disappear just use the WM_POPUP | WS_VISIBLE style in CreateWnd (again, I have no clue about the framework way of doing it...)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!