Re: [GD-Windows] Monitor aspect detection
Brought to you by:
vexxed72
From: brian s. <pud...@po...> - 2003-12-09 15:10:32
|
Does GetDeviceCaps() give you a clue about whether pixels are square? I'm thinking specifically of the ASPECTX and ASPECTY arguments. --brian On Tuesday, December 9, 2003, at 03:00 AM, Nicolas Romantzoff wrote: > Thanks Jon for the feedback... > > Getting the "maximum resolution" for width/height and using this as the > base aspect ratio (guessing the monitor do have square pixels) is what > I'm currently doing... And it seems to work fine on most CRTs, but for > my wife's computer. Sticked to a 1280x1024 heighest resolution (desktop > also in that resolution), this algorithm detects a ... 5:4 monitor. > > Other problem I came across was with a vertically positioned LCD (and > the funny thing is: a 1280x1024 vertically positioned 4:3 monitor). > Under that config, I detect a 4:5 monitor (I have no clue the monitor > has been positioned vertically). > > Final problem I already found: weird resolution LCDs. Things like > 1300x1060. > > One solution could have been to: > - Enumerate modes and compute a monitor-ratio based on highest width / > highest height displayable. > - Select the closest "well-known" format matching that ratio (4:3, > 16:9, > 3:4...) [if identical, stop here]. > - Enumerate modes and find the closest mode to "1:1" pixel-ratio for > that fixed monitor-ratio. > - Use that mode to compute the final monitor ratio. > > I'm currently using the first step only. > Adding the second step would solve trivial 1280x1024 best resolution > problems. > Adding the last 2 steps would solves strange resolution monitor > problems > some LCDs do have. > > Unfortunately, here is the configuration I'm currently using: ViewSonic > P95f + GeForce 3. > Highest resolution width: 1920 > Highest resolution height: 1200 > Resulting "ratio": 8:5 > Closest "well-known" ratio: 16:9 > Resolution matching that ratio: 1920x1080 => Monitor detected as a 16:9 > monitor ! > > > With different drivers: > Highest resolution width: 1920 > Highest resolution height: 1440 > Resulting "ratio": 4:3 > (though 1920x1080 and 1920x1200 resolutions still present). > > > I could select the well-known ratio by limiting myself to "lower" > ratios > only (giving me a 4:3 format for the first case), but I fear that on > some configs, the highest resolution would be 1920x1080 and back to a > wrong 16:9 detection. > > > Nicolas. > > > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...] On Behalf Of > Jon Watte > Sent: Tuesday, December 09, 2003 1:11 AM > To: gam...@li... > Subject: RE: [GD-Windows] (no subject) > > > To make things exciting, many LCD 1280x1024 monitors have square > pixels. > > I'd go with the assumption that monitors do have square pixels, and > thus > the view ratio == resolution ratio. Then supply a "special" option to > compensate for the known oddball cases, of which 1280x1024 on a 4x3 > monitor is the only obvious one. > > Well, there's the case of 800x600 being blown up to fullscreen on a > 16:9 > display, too, and stretching like mad. There's no good way of finding > this out. The best you can do is capture the resolution at start-up, > before mode switch, and assume it's square. |