Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Sat, 23 Feb 2008 14:43:00 -0800,    group: microsoft.public.platformsdk.gdi        back       


size of computer screen in inches   
I need to draw a rectangle whose actual size( in inches) does not change 
when a size of computer screen( in inches) is changed  to a different size( 
in inches).

I used the following API: 
        GetDeviceCaps(hIC,LOGPIXELSX) gives  pixels/inch,   and
        GetDeviceCaps(hIC,HORZRES)     gives  number of pixels 

But it does not lead to the true dimension of the computer screen when I use 
above parameters.

In fact, pixels/inch stays the same for the same number of pixels even when 
a different screen with different size is used.

Is there a way to get the size( in inches) of the computer screen.

I use C language on XP computer and use APIs with Visual C++ compiler.

Thank you

SpottyThe Dog
date: Sat, 23 Feb 2008 14:43:00 -0800   author:   ChangChiTheGraphics

Re: size of computer screen in inches   
"ChangChiTheGraphics"  wrote 
in message news:A751C880-08D2-401D-B9A2-1E13BF934E3C@microsoft.com...
>
> I need to draw a rectangle whose actual size( in inches) does not change
> when a size of computer screen( in inches) is changed  to a different 
> size(
> in inches).
>
> I used the following API:
>        GetDeviceCaps(hIC,LOGPIXELSX) gives  pixels/inch,   and
>        GetDeviceCaps(hIC,HORZRES)     gives  number of pixels
>
> But it does not lead to the true dimension of the computer screen when I 
> use
> above parameters.
>
> In fact, pixels/inch stays the same for the same number of pixels even 
> when
> a different screen with different size is used.
>
> Is there a way to get the size( in inches) of the computer screen.


There's no reliable way.  You can only get what the driver reports.  Even 
then, CRT view area can be stretched/compressed with the controls on the 
monitor, and unless there was a way for the monitor to report those 
settings, there's no way to get accurate values.

Mark

-- 
Mark Salsbery
Microsoft MVP - Visual C++


>
> I use C language on XP computer and use APIs with Visual C++ compiler.
>
> Thank you
>
> SpottyThe Dog
>
date: Mon, 25 Feb 2008 09:40:19 -0800   author:   Mark Salsbery [MVP] MarkSalsbery[MVP]@newsgroup.nospam

Re: size of computer screen in inches   
Thank you, Mark

Is there a way to get what the driver reports?

I do not need a accurate value but only to to adjust the figure approximately 
so it will not be terribly out of shape.

I keep thinking that this information must reside somewhere in the computer.
Would you tell me how I can get the driver reports?
Thank you again, Mark
SpottyThe Dog

Mark 

"Mark Salsbery [MVP]" wrote:

> "ChangChiTheGraphics"  wrote 
> in message news:A751C880-08D2-401D-B9A2-1E13BF934E3C@microsoft.com...
> >
> > I need to draw a rectangle whose actual size( in inches) does not change
> > when a size of computer screen( in inches) is changed  to a different 
> > size(
> > in inches).
> >
> > I used the following API:
> >        GetDeviceCaps(hIC,LOGPIXELSX) gives  pixels/inch,   and
> >        GetDeviceCaps(hIC,HORZRES)     gives  number of pixels
> >
> > But it does not lead to the true dimension of the computer screen when I 
> > use
> > above parameters.
> >
> > In fact, pixels/inch stays the same for the same number of pixels even 
> > when
> > a different screen with different size is used.
> >
> > Is there a way to get the size( in inches) of the computer screen.
> 
> 
> There's no reliable way.  You can only get what the driver reports.  Even 
> then, CRT view area can be stretched/compressed with the controls on the 
> monitor, and unless there was a way for the monitor to report those 
> settings, there's no way to get accurate values.
> 
> Mark
> 
> -- 
> Mark Salsbery
> Microsoft MVP - Visual C++
> 
> 
> >
> > I use C language on XP computer and use APIs with Visual C++ compiler.
> >
> > Thank you
> >
> > SpottyThe Dog
> >
date: Mon, 25 Feb 2008 11:05:01 -0800   author:   ChangChiTheGraphics

Re: size of computer screen in inches   
"ChangChiTheGraphics"  wrote 
in message news:39D31F1D-2A90-4101-9313-6879A718C384@microsoft.com...
> Thank you, Mark
>
> Is there a way to get what the driver reports?


That's what you're getting from GetDeviceCaps()....the problem is, the info 
isn't always reliable, as you've seen.
For example, the default VGA monitor driver can't possibly return an 
accurate pixels-per-inch value.

Mark

-- 
Mark Salsbery
Microsoft MVP - Visual C++


>
> I do not need a accurate value but only to to adjust the figure 
> approximately
> so it will not be terribly out of shape.
>
> I keep thinking that this information must reside somewhere in the 
> computer.
> Would you tell me how I can get the driver reports?
> Thank you again, Mark
> SpottyThe Dog
>
> Mark
>
> "Mark Salsbery [MVP]" wrote:
>
>> "ChangChiTheGraphics"  
>> wrote
>> in message news:A751C880-08D2-401D-B9A2-1E13BF934E3C@microsoft.com...
>> >
>> > I need to draw a rectangle whose actual size( in inches) does not 
>> > change
>> > when a size of computer screen( in inches) is changed  to a different
>> > size(
>> > in inches).
>> >
>> > I used the following API:
>> >        GetDeviceCaps(hIC,LOGPIXELSX) gives  pixels/inch,   and
>> >        GetDeviceCaps(hIC,HORZRES)     gives  number of pixels
>> >
>> > But it does not lead to the true dimension of the computer screen when 
>> > I
>> > use
>> > above parameters.
>> >
>> > In fact, pixels/inch stays the same for the same number of pixels even
>> > when
>> > a different screen with different size is used.
>> >
>> > Is there a way to get the size( in inches) of the computer screen.
>>
>>
>> There's no reliable way.  You can only get what the driver reports.  Even
>> then, CRT view area can be stretched/compressed with the controls on the
>> monitor, and unless there was a way for the monitor to report those
>> settings, there's no way to get accurate values.
>>
>> Mark
>>
>> -- 
>> Mark Salsbery
>> Microsoft MVP - Visual C++
>>
>>
>> >
>> > I use C language on XP computer and use APIs with Visual C++ compiler.
>> >
>> > Thank you
>> >
>> > SpottyThe Dog
>> >
date: Mon, 25 Feb 2008 12:22:55 -0800   author:   Mark Salsbery [MVP] MarkSalsbery[MVP]@newsgroup.nospam

Re: size of computer screen in inches   
ChangChiTheGraphics  wrote:
>
>Is there a way to get what the driver reports?
>
>I do not need a accurate value but only to to adjust the figure approximately 
>so it will not be terribly out of shape.
>
>I keep thinking that this information must reside somewhere in the computer.

Nope.  Windows simply does not know this.

One possible workaround is to display a ruler, have the user measure it,
and enter the actual length.  That's the only reliable method.
-- 
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
date: Mon, 25 Feb 2008 23:39:23 -0800   author:   Tim Roberts

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us