Ticket #9486 (infoneeded_new defect)
Blit() fails for wxScreenDC and wxClientDC on Mac
|Reported by:||Utensil||Owned by:||kollivier|
This bug's description is mentioned in the forum first time in
MacOS X: blitting from window gives greyscale image
And there was some technical discussion in
http://wxforum.shadonet.com/viewtopic.php?t=18468. Because this thread is long and was mainly discussing something else, so I paste the related part here:
A concern I have towards such a tool, is that on wxMac, Blitting screen captures with DCs is totally broken (screen DC just doesn't work, client DC gives grey and pale results), so unless it was fixed in trunk such tool will probably not work on all platforms anyway.
Stefan has mentioned that there is no longer a common screen buffer under Quartz, so yes, this couldn't be done with a wxScreenDC on Mac with wxMAC_USE_CORE_GRAPHICS = 1.
I can't find any bug reports or mailing list discussions in regards to wxClientDC on Mac OS X returning greyscaled results. In fact, the only place I see any mention of this is in one of your own posts. If I run into this, I'm sure I can either come up with something, or we can fallback to wxMAC_USE_CORE_GRAPHICS = 0 for this utility. We are looking for screenshots of controls, not device contexts, so I don't think it will matter with this off on Mac OS X.
Actually, in the very link you provided, the same problem is reported by another user, the OP And I actually met this problem when helping the wxSmith developer port his tool to the mac, with code that ran fine on both windows and linux, so I'm somewhat puzzled. Anyway I don't know that area of wx very much therefore I did not want to submit bug reports. Anyway we can get it done somehow or just another way, that's the important.
This bug is confirmed under Mac OS X against wx2.8.7. And it can be easily reproduced by the code snippet posted by upCase in post "How do I take a screenshot?" http://wxforum.shadonet.com/viewtopic.php?t=82&postdays=0&postorder=asc&start=30
Can anyone test and confirm it against trunk and/or Lepard? If you need a minimal prewritten test code, I'll attach it later.