![]() ![]() # finalize the CGImageDestination object. # When all the images (only 1 in this example) are added to the destination, Quartz.CGImageDestinationAddImage(dest, image, properties) # Add the image to the destination, characterizing the image with The default region is CG.CGRectInfinite (captures the full screen)ĭpi = 72 # FIXME: Should query this from somewhere, e.g for retina displaysĭest = Quartz.CGImageDestinationCreateWithURL( """region should be a CGRect, something like: If you don't need to do that, I'd recommend just calling the screencapture command (more features, more robust, and quicker - the initial PyObjC import alone can take around a second) import Quartz ![]() You can capture the entire screen, or specify a region to capture. Here's how to capture and save a screenshot with PyObjC, based on my answer here
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |