How do i go about ensuring that my application window will show well in all resolutions (from Crt - High Res LCD)...
Or do i rather ensure that when i create Window my size in no larger than 800x600... ?
Printable View
How do i go about ensuring that my application window will show well in all resolutions (from Crt - High Res LCD)...
Or do i rather ensure that when i create Window my size in no larger than 800x600... ?
I'm not sure, but I believe you want to catch the VM_NCCREATE and/or VM_CREATE and set the size of the window within the CREATESRUCT.
--
Mats
It's a complex issue from the design point of view. Usually you design for on one resolution (preferably the minimum one) and make an effort to ensure a fluid design (some like to call it Liquid).
So, assuming you set 800x600 as the minimum requirements, you lay out your controls for this window size. Then what?
Well, this is where it gets complicated. You have to establish what controls are allowed to move and what controls are allowed to resize when the window changes sizes, coding this into the resize events you are catching (I can't help with Windows API or MFC. Only WxWidgets).
Observe some applications and look at how some controls remain still and unchanged, while others move and/or change size in the window when you resize it. That's what you would ideally want to achieve. Some tools offer easy shortcuts for this. WxWidgets (a GUI api), for instance offers Sizers which makes the design of fluid layouts a kid's play (after you get used to the philosophy behind, that is). MFC and Win32 API will force you to code the whole thing EDIT: unless you have access to RAD tools with click & drag control placement which usually offer their own methods. But as long as you know how you want a window to increase its size, it's just not that difficult, I'm sure.
Came across functions such as "GetSystemMetrics" and "GetTextMetrics" which retrieves the window size per resolution and text size per resolution... My concerns as you mention are controls within the windows, such as edit controls and buttons... I guess the best option is to design for 800x600, but then how would the application look in a screen resolution of 1280X1024? Is it going to stretch or something?
Of course. You have to stretch your controls to a larger width/height, but I would usually design for 1024x768 or 1280x1024 resolution, as they are pretty common today.
Changing resolutions will not deface your controls in any way (with one exception). Any operating system offering a GUI worth its salt will automatically scale you controls accordingly. The end result will still be a window with crisp looking controls. So if you layout for, say 800x600, and then change the resolution for 1024x768, your window will look smaller on the screen and all controls will be scaled accordingly.
Basically what this means is that as far as resolutions are concerned, the operating system will do that for you scaling things on screen accordingly (like just it does with your applications). But because changing resolutions affect the free space outside the window, usually we want to allow users to resize their windows. On that case you need to catch window resize events (do not use window paint events or load events. A resize event is also handled during window first load) and move and resize your controls as you wish.
...
The only exception to the resolution changing not affecting the detail and crispness of your screen is if you are using a wide screen monitor and want to look at default resolution ratios (or the other way around). Typical resolutions have a ratio of 1.3 (jut divide 800 by 600 for instance). Widescreen monitors offer resolutions with ratios of 1.6 and higher I reckon. When displaying resolutions with different ratios your screen may look blurred. You should not worry, because a) it's dependent on monitor quality and b) it's only the result of someone using the wrong suggested resolution for their screen type which basically means is not your problem.
EDIT: In other words and to make this short, your only concern should be the current window size, not the resolution of the screen.
1 - Set a minimum requirements resolution ( 800x600 is a common choice depending on the application)
2 - Design you windows content with this resolution in mind.
3 - Catch window resize events, read the current values from within and move and resize you controls accordingly.
Standard resolution is 4/3 (1024x768, 1280x1024 for example). Widescreen is 16/9 (1280x720 for example), or 16/10 (1920x1200 for example).
16/10 is more common for today's computer screens, but TVs are still 16/9. 4/3 monitors exist for lower-end computer screens and laptops and 4/3 TVs are being phased out, pretty much. Or will be.
If you are doing manual blitting, just resample the image to the higher resolution. You wont be able to tell its runnign in higher reslolution, but at least it will look normal.
Tried running a simple application (window with a gray shaded rectangle with one object drawn unto it) on an NT4 Machine which has a max screen resolution of 800x600 and Max of 16 colors. Well this application window is small enough to fit any resolution but problem i picked up was the gray shade on rectangle was more lighter and showing lines on background instead of full shade. Also, the application was flickering which was not happening on my XP PC... Thought XP was NT as well
Win 2000 was an NT core, XP is not.
If the NT PC was running 800x600 in 16 colours (I think you mean 16 bit) it probably has a VERY slow graphics card. It may mot be possible to not flicker, depending on your app.
If the NT machine is your target then develop/test on that machine and adjust accordingly.
If the NT is not a required target machine, ignore it, some machines are too slow/old to modify your apps to run on.
Precisely. But that was my point anyways. It felt to me the OP was unsure as to how things would change in different resolutions. I had to note the only concern should be in the context of layout within the given window size, not screen resolution.
Hello again... To design an application for 800x600, do i just set the window size to 800x600, or do i need to change my PC screen resolution to 800x600 then set the screen to default size?
Just make sure the minimum size of your window wouldn't go over about 800x570.
You don't need to change resolution, just window size.
You I still think you should develop for 1024x768 at least.
Developing for does not mean the same as eat bigger space.
Most people nowadays use 1024 x 768 or higher, therefore it makes sense to target those resolutions.
(There was very few who use 800x600 today, I dare say.)
So you want to develop for, but not actually use 1024x768, so wtf is the point then? You really shouldnt assume that everyone is developing for the average consumer. I would say most software development today is for niche markets where the hardware may not necessaily be a top end consumer system. You really really need to learn to keep a more open mind.
What is the point of any resolution?
Heck, we don't use 800x600, so we can just as well develop for 320x240 or something.
And secondly, 800x600 is pretty big for "other" things out there. Cell phones use like 320x2480 MAX.
So if it's 800x600, I imagine it can just as well be 1024x768, the "normal" resolution nowadays.
Unless there's more information about where this project is aimed at what resolution is the one used there.
Well since the OP asked about 800x600 specifically I assume there is some reason he chose that resolution. Maybe thats the highest res his system can handle, maybe its the lowest, meaybe its just the one he is familar with, maybe he has an existing application he wants to make full screen, lots of maybes, none have anythign to do with elysia.
But maybe the OP has never stated WHY 800x600 is THE resolution OR tried to address the 1024x768 might be better statement. And I haven't been spouting "use X resolution" only posts.
That would clearly be spam. They have been added as afterthought to other replies.
Let me remind you - there are different kind of applications. Ones that are just small windows, fullscreen applications, many different needed sizes. You can't assume everyone should use the same window size for every application, can you? You can't assume EVERY window is fullscreen.
That's because he probably wants it to be compatible with all kinds of computers, even the minority. Why do you have to be so mad at Elysia? It was just a suggestion.
If the target machine is a PC running any mainstream operating system or one of its earlier versions, 800x600 is still pretty much the standard minimum resolution.
The operative words are standard and minimum. What it means basically is that if the programmer doesn't know a thing about the target machines that will run his application, developing for 1024x768 will break for some users, whereas developing for 800x600 will work for everyone. Window resizing and automatic layout adjustments I mentioned earlier somewhere on this thread, are the best way to go about designing for a minimum resolution and still maintain a pleasant look in higher resolutions. If no one asks me, and I no little of who wil run my app, I design for 800x600 every day of the week. This way I can ensure my app runs even if the user didn't have his graphics card drivers.
That's when we don't know anything except the target OS. So, abachler advise is the correct one, in my opinion. On this case designing for anything above 800x600 is a bad idea. Designing for anything below 800x600 is silly.
The next thing is target users. If you are coding a power app meant to be used by power users or conversely you are coding an invoice application meant to be used by small businesses... I don't think I need to go on with this paragraph. You get the idea.
It's completely irrelevant what we don't know. What is important is what we know. Since we know very little, I advise 800x600 and ask the OP to detail what type of application this is.
Just a note: Contrary to what I'm hearing here 1024x768 is NOT the standard minimum resolution out there. Don't even go there. Many, many computers are used by older people, people with disabilities, people in business which are still using 5 (if not more) year old machines, people in the government which are still using 10 (if not more) year old machines, children, ... What more, the emergence of small screen laptops has been having an annoying side effect of making some people adopt again lower resolution settings.