Re: Monitor aspect ratio



Well there is an assumption here. I assume that the user has his desktop
resolution set to give a square pixel (it's uncommon that people leave their
working
desktop resolution stretched). So, given that his screen's square pixel
is at an aspect ratio of 1.6, then you can calculate the ratio you need for
the resolution you'll be running at...

If the user has his desktop set to a resolution that doesn't preserve square
pixels, then his whole Windows experience is stretched, and the square
pixels might look strange to him in the end :)

Wessam Bahnassi
Microsoft DirectX MVP,
Lead Programmer
In|Framez

"Robert Dunlop [MS MVP]" <rdunlop@xxxxxxxx> wrote in message
news:uS3OiNlpFHA.3516@xxxxxxxxxxxxxxxxxxxxxxx
> "Wessam Bahnassi" <wbahnassi@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
> message news:er7dO0hpFHA.1464@xxxxxxxxxxxxxxxxxxxxxxx
>> You can read the current display mode of the monitor before changing the
>> display mode yourself in D3D. Since the current display mode reflects the
>> user's desktop aspect ratio, then just divide its width by its height and
>> voiala... On my laptop's widescreen, the display mode is 1680x1050, which
>> means its aspect ratio is 1.6...
>
> You are assuming here that the pixels are square? If you were to measure
> your desktop, is the ratio of physical width to height 1.6:1? I don't
> think this can be assumed, for example in my desktop control panel I have
> 5 different resolutions with 1280 columns, ranging from 1280x720 to
> 1280x1024. So while the physical aspect ratio of the monitor is 4:3
> (1.3333), the ratio of horizontal to vertical pixels could be 1.77778,
> 1.66667, 1.6, 1.33333, or 1.25, depending on the selected desktop
> resolution.
>
> You can use the GDI function GetDeviceCaps to read the dimensions of a
> display referenced by a device context:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_88s3.asp?frame=true
>
> For example, I've used the following code for reading the physical
> dimensions of the desktop device:
>
> HDC hdc;
> hdc=GetDC(0);
> int widthInMM=GetDeviceCaps(hdc,HORZSIZE);
> int heightInMM=GetDeviceCaps(hdc,VERTSIZE);
>
> To determine the aspect ratio of a monitor on a multimonitor systems, you
> would want to use a DC for the specific monitor in question.
>
>
> --
> Robert Dunlop
> The X-Zone
> http://www.directxzone.com/
> Microsoft DirectX MVP
> -------------
> The opinions expressed in this message are my own personal views and do
> not reflect the official views of the Microsoft Corporation.
> The MVP program does not constitute employment or contractual obligation
> with Microsoft.
>



.



Relevant Pages

  • Re: A question about resolution (screen and DPI)
    ... 1024x768, is the number of pixels visible ... generally appear to be square. ... If you switch to a higher screen resolution then a feature ... DPI is calculated as the number of pixels in a certain ...
    (comp.os.linux.x)
  • Re: Determining the Shape of Pixels and Frames
    ... of an image is changed from 640 to 720 pixels wide, ... Video Cassette) specifies the resolution for converting analog NTSC and PAL television video to digital video. ... frame aspect ratio of 4:3. ... The DV standard specifies ...
    (microsoft.public.windowsxp.moviemaker)
  • Re: Resolution or ratio set first?
    ... ratio, the 16:9 ratio my digital frame uses. ... Set the resolution to 900x500 first. ... I also interpreted 900x500 to be the dimensions of the image in pixels. ... what you need to do is to resize the image such that you can ...
    (rec.photo.digital)
  • Re: HDTV Channels on Dish... Are some true HDTV???
    ... I use my TV's menu to control the aspect ratio. ... | end user gets better resolution if the display sets the aspect ratio. ... arrangement if pixels would be what I suggest. ...
    (alt.tv.tech.hdtv)
  • Re: aspect ratio
    ... imperative that you leave your monitor set to its native resolution ... native resolution of 1000 x 1000 pixels, ... is that your image does not mysteriously become a square because the screen ... The aspect ratio is adjusted so that images look normal on ...
    (alt.graphics.photoshop)