I am working on a project where I have to return number of millimeters or centimeters or whatever traversed by a mouse.
Now, whoops, this is a bit tricky as every screen is different.
I found a nice function: wx.DC.GetSizeMM() that should have solved this problem for me.
My hopes went up, but it gives me some extremely dubious results.
On my PC under Windows:
>>> app = wx.App()
>>> dc = wx.ScreenDC()
>>> dc.GetSize() # Get resolution in pixels:
wx.Size(1680, 1050)
>>> dc.GetSizeMM() # Now this is completely off as these should be mm we're looking at:
wx.Size(432, 270)
>>>
My screen is at least 1 cm wider than dc.GetSizeMM() thinks it is.
For a: wx.MemoryDC(wx.EmptyBitmap(100, 100)).GetSizeMM() I get wx.Size(25, 25). I mean, come on, completely ridiculous!
Edit: OK, maybe not so completely. :D
It is obvious that aspect ratio is fine, but what factor is used to convert?
What am I missing? Why doesn't it work?