Re: Windows DPI settings



On Jul 17, 9:07 am, David R. Longnecker <dlongnec...@xxxxxxxxxxxxxxxx>
wrote:
System Metrics
Microsoft® Windows® provides a number of system metrics that you should use
to eliminate assumptions about the user's system. GetDeviceCaps() can be
used to obtain a display's DPI (pass in LOGPIXELSX or LOGPIXELSY for the
second parameter). GetSystemMetrics() and SystemParametersInfo() provide
sizes for nearly every graphical element in Windows, from the width of a
three-dimensional border to the size of a small icon. One of the less obvious
metrics is the minimum line thickness (pass SM_CYBORDER or SM_CXBORDER to
GetSystemMetrics). At very high DPIs, a one-pixel-wide line is nearly invisible.

http://msdn2.microsoft.com/en-us/library/ms969894.aspx

HTH.

-dl

--
David R. Longneckerhttp://blog.tiredstudent.com

Hi,
is there any way how can I get the current user windows DPI settings?
We're writting some mapping software and we need to know if the user
changes the DPI for scale calculations.
Thanks
Jan

Or, in the .Net world, you could try this:

using (Graphics g = this.CreateGraphics()) {
MessageBox.Show("DpiX: " + g.DpiX.ToString() + ",
DpiY: " + g.DpiY.ToString());
}


.



Relevant Pages

  • Re: Windows DPI settings
    ... Microsoft® Windows® provides a number of system metrics that you should use to eliminate assumptions about the user’s system. ... GetDeviceCapscan be used to obtain a display’s DPI. ... GetSystemMetrics() and SystemParametersInfoprovide sizes for nearly every graphical element in Windows, from the width of a three-dimensional border to the size of a small icon. ... is there any way how can I get the current user windows DPI settings? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: I wonder how Dpreview will handle....
    ... David J Taylor added these comments in the current discussion du ... they normally place images at native size - by dimensions not ... I stopped referring to PPI as DPI ages ago the same as I stopped ... how many pixels is enough ... ...
    (rec.photo.digital.slr-systems)
  • Re: 35mm film VS digital
    ... "David J Taylor" ... You can scan film negatives at ... Most digital cameras only give you 72 DPI. ...
    (rec.photo.digital)
  • Re: Poor font and graphic resolution
    ... "David" wrote in message ... > Do you mean when the DPI is set to 96? ... Select a lower desktop resolution. ... Protect your PC ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Screen Res and DPI
    ... system metrics, such as screen resolution. ... I'm not sure if it returns dpi - ... in the declaration section; I'm not aware of any other source of code for ...
    (microsoft.public.access.formscoding)