Problem getting widget bitmap under OSX

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 can confirm that this looks like a retina issue.

I have an eternal monitor plugged into a retina macbook. If I screen
shot with the window on the retina display I see the issue with the
zoomed in image, bit if I move the window onto the external display
and generate the image, it's of the whole panel.

Ross Wilson wrote:

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
Sample get widget bitmap - Pastebin.com. 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?

I expect that it can be made to work, but that it will require work in the wxWidgets code. Create a ticket for it at trac.wxwidgets.org and set the Component to wxOSX-cocoa.

···

--
Robin Dunn
Software Craftsman

Thanks Paul and Robin. I'll submit to the wx trac.

Might even look at the wx code yo see hiw confused I get.

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/Problem-getting-widget-bitmap-under-OSX-tp5722438p5722652.html
Sent from the wxPython-users mailing list archive at Nabble.com.

I am facing this issue with wxWidgets 3.0 now itself. Did you guys able to fix this issue.?

···

On Friday, 26 September 2014 23:24:16 UTC+5:30, rzzzwilson wrote:

Thanks Paul and Robin. I’ll submit to the wx trac.

Might even look at the wx code yo see hiw confused I get.

View this message in context: http://wxpython-users.1045709.n5.nabble.com/Problem-getting-widget-bitmap-under-OSX-tp5722438p5722652.html

Sent from the wxPython-users mailing list archive at Nabble.com.