Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Monitor Size
|
Re: Monitor Size [message #16542 is a reply to message #16525] |
Mon, 23 June 2008 22:47   |
|
I found in windows solution:
HDC hdc = ::GetWindowDC(NULL);
int width_mm = ::GetDeviceCaps(hdc, HORZSIZE);
int height_mm = ::GetDeviceCaps(hdc, VERTSIZE);
::ReleaseDC(NULL, hdc);
But how will be in linux?
|
|
|
Re: Monitor Size [message #16545 is a reply to message #16542] |
Tue, 24 June 2008 13:07   |
|
Well!
Thank you to Max and Andrei for help me to detect monitor size in millimetres:
I propose to add a function in u++ to get windows size in millimetres
for example:
Size GetScreenSizeMM();
for windows will be:
Size GetScreenSizeMM(){
return(GetSizeCaps(HORZSIZE, VERTSIZE))
}
and for linux:
Size GetScreenSizeMM(){
return Size(DisplayWidthMM(Xdisplay, Xscreenno), DisplayHeightMM(Xdisplay, Xscreenno));
}
This function will be helpful for me and other programmers! It can be integrate in print preview for zooming 100% size!
[Updated on: Tue, 24 June 2008 13:08] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Sun Apr 27 22:13:56 CEST 2025
Total time taken to generate the page: 0.00891 seconds
|