• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CGWindowListCreateImage fails on Snow Leopard with kCGNullWindowID
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CGWindowListCreateImage fails on Snow Leopard with kCGNullWindowID


  • Subject: CGWindowListCreateImage fails on Snow Leopard with kCGNullWindowID
  • From: Jason Foreman <email@hidden>
  • Date: Thu, 10 Sep 2009 09:32:30 -0500


I am attempting to use the CGWindowListCreateImage function to capture a desktop screenshot. The following code (taken straight from the SonOfGrab sample) works on Leopard, but is failing on Snow Leopard:


CGImageRef screenShot = CGWindowListCreateImage(CGRectInfinite, kCGWindowListOptionOnScreenOnly, kCGNullWindowID, kCGWindowImageDefault);

On Leopard, the returned CGImageRef is what I expect: an image of the desktop and all on-screen windows.

On Snow Leopard, the CGImageRef is NULL and the following message is printed to the console:

	<Error>: CGImageCreate: invalid image bits/pixel or bytes/row.


I have filed a bug (7212104), but wonder if there is a workaround that I can use in the meantime, or if I should just use another method of capturing the desktop. Has anyone else encountered this issue?



Thanks,

Jason

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: CGWindowListCreateImage fails on Snow Leopard with kCGNullWindowID
      • From: David Duncan <email@hidden>
  • Prev by Date: Re: Show/Hide file extension issue in savePanel
  • Next by Date: [SOLVED] Re: Custom NSActionCell subclass + table column binding
  • Previous by thread: Re: Scrolling NSScrollView by fractional amounts - why would values get rounded?
  • Next by thread: Re: CGWindowListCreateImage fails on Snow Leopard with kCGNullWindowID
  • Index(es):
    • Date
    • Thread