Discussion:
Problem getting widget bitmap under OSX
Ross Wilson
2014-09-07 06:33:01 UTC
Permalink
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
--
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.
Paul Wiseman
2014-09-19 14:13:38 UTC
Permalink
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.
--
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.
Robin Dunn
2014-09-24 01:05:22 UTC
Permalink
Post by Ross Wilson
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?
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
http://wxPython.org
--
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.
rzzzwilson
2014-09-25 01:09:28 UTC
Permalink
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.
--
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.
Continue reading on narkive:
Search results for 'Problem getting widget bitmap under OSX' (Questions and Answers)
5
replies
How to write thesis?
started 2007-07-25 02:09:14 UTC
higher education (university +)
Loading...