Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Monitor Size
Monitor Size [message #16525] Sun, 22 June 2008 17:33 Go to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

How can I get real monitor size in inch or cm in u++?
Re: Monitor Size [message #16542 is a reply to message #16525] Mon, 23 June 2008 22:47 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

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 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

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

Re: Monitor Size [message #16553 is a reply to message #16525] Wed, 25 June 2008 10:40 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
tojocky wrote on Sun, 22 June 2008 11:33

How can I get real monitor size in inch or cm in u++?


I think Draw::GetPageMMs should work (althought I have only used it for printing to physical media so far).

Mirek
Re: Monitor Size [message #16555 is a reply to message #16553] Wed, 25 June 2008 17:03 Go to previous message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

Thank you! Draw::GetPageMMs is great! I'm new in u++ and didn't found it. In future I will try to find more detailed!
Previous Topic: RemoveChild(GLCtrl) --> 100% CPU
Next Topic: Ctrl::Add(GLCtrl) Bug (Linux)
Goto Forum:
  


Current Time: Thu Apr 18 16:49:18 CEST 2024

Total time taken to generate the page: 0.02018 seconds