Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Convert pixels to mm
Convert pixels to mm [message #488657] Tue, 29 September 2009 16:01 Go to next message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi,

In GMF we are doing pixel to mm or inches conversion based on the DPI (Device#getDPI()). However, this doesn't depend on the screen resolution. Hence, we'd like to try something that does consider the screen resolution. Is there a utility method that could convert pixel to mm acounting for screen resolution? Otherwise, perhaps there are utility methods to determine physical screen size and the resolution?

Thanks.

Cheers,
Alex
Re: Convert pixels to mm [message #489766 is a reply to message #488657] Mon, 05 October 2009 19:44 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi, sorry for the late response,

Computing the physical screen size should just be "width =
monitor.getBounds().x * Device.getDPI().x" and "height =
monitor.getBounds().y * Device.getDPI().y". Is this enough to do what you
want?

Grant


"Alex Boyko" <aboyko@ca.ibm.com> wrote in message
news:h9tb14$oip$1@build.eclipse.org...
> Hi,
>
> In GMF we are doing pixel to mm or inches conversion based on the DPI
(Device#getDPI()). However, this doesn't depend on the screen resolution.
Hence, we'd like to try something that does consider the screen resolution.
Is there a utility method that could convert pixel to mm acounting for
screen resolution? Otherwise, perhaps there are utility methods to determine
physical screen size and the resolution?
>
> Thanks.
>
> Cheers,
> Alex
>
Previous Topic:CoolBar not appearing in Windows Vista or 7?
Next Topic:highlight or color the border of SWT widget
Goto Forum:
  


Current Time: Fri Apr 19 02:14:09 GMT 2024

Powered by FUDForum. Page generated in 0.01857 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top