 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
C. Bond Guest
|
Posted: Fri Oct 03, 2003 2:15 am Post subject: video mode/pixel format |
|
|
How can I determine the desktop video mode/pixel format of the system
when my application starts?
--
Democracy: The triumph of popularity over principle.
--
http://www.crbond.com
|
|
| Back to top |
|
 |
Wim Bekker Guest
|
Posted: Fri Oct 03, 2003 2:41 pm Post subject: Re: video mode/pixel format |
|
|
Use VCL:
ScreenWidth=Screen().Width;
ScreenHeight=Screen().Height;
Or use NativeAPI:
HDC hdc=GetDC(NULL);
ScreenWidth=GetDeviceCaps(hdc,HORZRES);
ScreenHeight=GetDeviceCaps(hdc,VERTRES);
Wim
"C. Bond" <cbond (AT) ix (DOT) netcom.com> schreef in bericht
news:3F7CDBCF.3565CCC8 (AT) ix (DOT) netcom.com...
| Quote: | How can I determine the desktop video mode/pixel format of the system
when my application starts?
--
Democracy: The triumph of popularity over principle.
--
http://www.crbond.com
|
|
|
| Back to top |
|
 |
C. Bond Guest
|
Posted: Fri Oct 03, 2003 4:01 pm Post subject: Re: video mode/pixel format |
|
|
Wim Bekker wrote:
| Quote: | Use VCL:
ScreenWidth=Screen().Width;
ScreenHeight=Screen().Height;
Or use NativeAPI:
HDC hdc=GetDC(NULL);
ScreenWidth=GetDeviceCaps(hdc,HORZRES);
ScreenHeight=GetDeviceCaps(hdc,VERTRES);
Wim
"C. Bond" <cbond (AT) ix (DOT) netcom.com> schreef in bericht
news:3F7CDBCF.3565CCC8 (AT) ix (DOT) netcom.com...
How can I determine the desktop video mode/pixel format of the system
when my application starts?
|
Well, I can use "Screen" to get the height and width, but how do I get the
video mode and pixel format?
--
There are two things you must never attempt to prove: the unprovable -- and
the obvious.
--
Democracy: The triumph of popularity over principle.
--
http://www.crbond.com
|
|
| Back to top |
|
 |
Wim Bekker Guest
|
Posted: Mon Oct 06, 2003 10:33 am Post subject: Re: video mode/pixel format |
|
|
As far as I know, the 'video mode' isn't just a single value. Every
VideoMode is build up in a TDevMode struct (_devicemodeA).
To get the current VideoMode, you first have to EnumDisplaySettings and
store all results (where DevMode.dmDisplayFrequence>1) in a TDevMode list.
Then you need the BITSPIXEL, HORZRES, VERTRES and VREFRESH values from
GetDeviceCaps, and compare them to the items in the TDevModeList. When
there's match, you've found the current VideoMode (the entry in the
TDevModeList).
BITSPIXEL gives you the pixelformat but you have to interpret it to use it.
You can use the entries in the TDevModeList to change the DisplaySettings
(and use NULL to get the default DisplaySettings).
Wim
"C. Bond" <cbond (AT) ix (DOT) netcom.com> schreef in bericht
news:3F7D9D63.EFC5ABED (AT) ix (DOT) netcom.com...
| Quote: | Wim Bekker wrote:
Use VCL:
ScreenWidth=Screen().Width;
ScreenHeight=Screen().Height;
Or use NativeAPI:
HDC hdc=GetDC(NULL);
ScreenWidth=GetDeviceCaps(hdc,HORZRES);
ScreenHeight=GetDeviceCaps(hdc,VERTRES);
Wim
"C. Bond" <cbond (AT) ix (DOT) netcom.com> schreef in bericht
news:3F7CDBCF.3565CCC8 (AT) ix (DOT) netcom.com...
How can I determine the desktop video mode/pixel format of the system
when my application starts?
Well, I can use "Screen" to get the height and width, but how do I get the
video mode and pixel format?
--
There are two things you must never attempt to prove: the unprovable --
and
the obvious.
--
Democracy: The triumph of popularity over principle.
--
http://www.crbond.com
|
|
|
| Back to top |
|
 |
C. Bond Guest
|
Posted: Mon Oct 06, 2003 5:36 pm Post subject: Re: video mode/pixel format |
|
|
Wim Bekker wrote:
| Quote: | As far as I know, the 'video mode' isn't just a single value. Every
VideoMode is build up in a TDevMode struct (_devicemodeA).
To get the current VideoMode, you first have to EnumDisplaySettings and
store all results (where DevMode.dmDisplayFrequence>1) in a TDevMode list.
Then you need the BITSPIXEL, HORZRES, VERTRES and VREFRESH values from
GetDeviceCaps, and compare them to the items in the TDevModeList. When
there's match, you've found the current VideoMode (the entry in the
TDevModeList).
BITSPIXEL gives you the pixelformat but you have to interpret it to use it.
You can use the entries in the TDevModeList to change the DisplaySettings
(and use NULL to get the default DisplaySettings).
Wim
|
Thanks for the detailed answer. It does seem strange, though, that you can set
the video mode from the desktop, but cannot just read it directly somewhere.
--
Democracy: The triumph of popularity over principle.
--
http://www.crbond.com
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|