[Pythonmac-SIG] Capturing system screen pixels on OSX

tburbage3 at excite.com tburbage3 at excite.com
Tue Feb 24 14:50:36 EST 2004


 I'm experimenting with a means via Python to capture a rectangle of the screen for the purpose of software/UI testing. I'm using Python because I need a cross-platform solution: Windows, OS10.3.x -- eventually Linux. I'm using the latest "stable" versions of Python and the packages mentioned below. Jack (Jensen), I have your stuff installed and working, and also used the database from <http://undefined.org/python/pimp/> to get all of the packages installed properly. The script currently uses: OpenGL.GL, OpenGL.GLUT -- to establish a graphics context/display mode (RGB/single buffer) and gain access to pixel data in the framebuffer.Image (PIL) -- to save the buffer contents to file. The script specifically uses GLUT's 'glutEnterGameMode()' to establish the full screen as the viewport, then uses glReadPixels() to get the desired capture subregion (rect). This script works perfectly on Windows, but on OSX I end up with (seemingly) random RGB values.The script makes one critical assumption that on Windows at least is true: that when GLUT establishes it's graphics context and "takes over the screen buffer" the contents of the front buffer ARE the current screen contents until glClear() is called or some other drawing operation is done. Needless to say, there could be alot of reasons why my approach isn't working on OSX, so I thought it time to ask folks in the community familiar with graphics programming on OSX whether the approach I've generally describes sounds like it *should* work (meaning I might just need to keep tweaking) or that there might be a more effective approach. Thanks,Tom BurbageRedwood City, CA   

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20040224/c77d23e5/attachment.html


More information about the Pythonmac-SIG mailing list