Programming UI w/ 120DPI fonts.

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Does anybody here have any sites or information about
programming a VB.NET UI with 120DPI fonts. There are a
lot of form size properties that seem to go way out of
whack when you change the font DPI. Clientsize, and size
properties seem way bigger than my resolution is even set
to. I know how to detect the 120 font DPI, but I'm really
confused as to the relationship between Control size
properties and the inreast font DPI.

Does the unit of measurement change? When I have my
computers resolution set to 1280X1024 and 120DPI fonts,
the size property on my forms can come out to 2500 or even
higher. Since the form is maximized, it can't possibly be
representing it in pixels, and not only that but I never
changed it anyways.

Is there an easy way to dynamically change component sizes
with a calculation containing the font DPI so everything
fits properly? Has anyone else had to try and deal with
this problem?

Thanks in advance to all those who can help, and I
understand that this isn't strictly a VB.NET problem but
hopefully somebody has some insight.
 
Hello, Jason:

The font size is handled through the Form.AutoScaleBaseSize and Form.AutoScale properties (see http://msdn.microsoft.com/library/d...SystemWindowsFormsFormClassAutoScaleTopic.asp)

You can also find a single explanation at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms12102002.asp.

You can get the DpiX and DpiY properties of a graphics object created from a control (for example) to know the current font size (72 dots=1 inch).

Let me make a reflexion at this point: What Windows names "Font size" is in fact "device resolution" in physical units... but actual monitors don't inform Windows about the REAL size of a pixel (at 800x600, for example), which could be very helpful. Why the manufacturers don't want to do this?

Regards.


"Jason" <[email protected]> escribió en el mensaje | Does anybody here have any sites or information about
| programming a VB.NET UI with 120DPI fonts. There are a
| lot of form size properties that seem to go way out of
| whack when you change the font DPI. Clientsize, and size
| properties seem way bigger than my resolution is even set
| to. I know how to detect the 120 font DPI, but I'm really
| confused as to the relationship between Control size
| properties and the inreast font DPI.
|
| Does the unit of measurement change? When I have my
| computers resolution set to 1280X1024 and 120DPI fonts,
| the size property on my forms can come out to 2500 or even
| higher. Since the form is maximized, it can't possibly be
| representing it in pixels, and not only that but I never
| changed it anyways.
|
| Is there an easy way to dynamically change component sizes
| with a calculation containing the font DPI so everything
| fits properly? Has anyone else had to try and deal with
| this problem?
|
| Thanks in advance to all those who can help, and I
| understand that this isn't strictly a VB.NET problem but
| hopefully somebody has some insight.
|
|
 
Back
Top