Ross Wilson
2014-09-07 06:33:01 UTC
Hi All,
I have an existing desktop application that snapshots part or all of the
application window to a picture file. This works on Windows 7 and Linux
(xubuntu). However, I've moved to developing on Mac, and I find that
the snapshot no longer works correctly on my laptop, a retina MacBook
Pro (rMBP). I've searched for this in the group archives but found
nothing related.
I have code that gets the bitmap of either a custom widget (derived from
Panel) or the entire application window and saves the bitmap to a file.
On the rMBP I get a bitmap but it's only the top left quarter. Works
fine on Win/Linux. It's probably related to the retina screen. I
vaguely remember some technical discussion of the retina screen having
some sort of "bit doubling" technique.
I have written a small application that shows the problem, at
http://pastebin.com/0997SSpn. Run it and click on the panel which saves
a PNG of the bitmap in file ./test.png. The code doing the snapshot is
in the on_event()event handler. Method 1 (active in the given code) is
simple but gives me the top left quarter only. Method 2 is more
complicated and gives the same results as method 1. I've even tried
doubling the X and Y sizes of the capture from the widget bitmap but
that doesn't work (of course).
This is on a rMBP running OS X 10.9.4, python 2.7.5 and wx.version()
shows "3.0.0.0 osx-cocoa (classic)".
Any ideas on how to get round this?
Thanks,
Ross
I have an existing desktop application that snapshots part or all of the
application window to a picture file. This works on Windows 7 and Linux
(xubuntu). However, I've moved to developing on Mac, and I find that
the snapshot no longer works correctly on my laptop, a retina MacBook
Pro (rMBP). I've searched for this in the group archives but found
nothing related.
I have code that gets the bitmap of either a custom widget (derived from
Panel) or the entire application window and saves the bitmap to a file.
On the rMBP I get a bitmap but it's only the top left quarter. Works
fine on Win/Linux. It's probably related to the retina screen. I
vaguely remember some technical discussion of the retina screen having
some sort of "bit doubling" technique.
I have written a small application that shows the problem, at
http://pastebin.com/0997SSpn. Run it and click on the panel which saves
a PNG of the bitmap in file ./test.png. The code doing the snapshot is
in the on_event()event handler. Method 1 (active in the given code) is
simple but gives me the top left quarter only. Method 2 is more
complicated and gives the same results as method 1. I've even tried
doubling the X and Y sizes of the capture from the widget bitmap but
that doesn't work (of course).
This is on a rMBP running OS X 10.9.4, python 2.7.5 and wx.version()
shows "3.0.0.0 osx-cocoa (classic)".
Any ideas on how to get round this?
Thanks,
Ross
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.