• 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
Re: NSImage lockFocus throws exception?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage lockFocus throws exception?


  • Subject: Re: NSImage lockFocus throws exception?
  • From: John Stiles <email@hidden>
  • Date: Wed, 21 Mar 2007 10:59:21 -0700

Thanks for the responses, folks!
Sure enough, a call to NSApplicationLoad() did the trick. That was easy! Now back to work… :)



On Mar 20, 2007, at 7:35 PM, John Pannell wrote:

Hi John-

Your email caught my eye because I have long thought of myself as having been through just about all of the ins-and-outs that NSImage could provide :-) But alas, this is a new one to me.

I did google the error code, however, and came across another thread regarding a Cocoa-from-Carbon issue:

http://lists.apple.com/archives/carbon-dev/2006/Aug/msg00799.html

With this resolution:

http://lists.apple.com/archives/carbon-dev/2006/Aug/msg00801.html

In this person's case, apparently NSApplicationLoad() needed to be called to get the window server responsive to the Carbon app... this might explain why NSImage is happy until it needs to draw a cached representation of itself in a cache window, and cannot seem to generate the window.

Could be way off base, but hopefully provides a starting point - HTH!

John

John Pannell
Positive Spin Media
http://www.positivespinmedia.com

On Mar 20, 2007, at 7:51 PM, John Stiles wrote:

I'm trying to use NSImage from within a largely Carbon-based application.
I can create an image fine by using NSImage's initWithData. It succeeds, and if I ask for its size with [[[image representations] objectAtIndex:0] size], it is correct.
However, when I call [image lockFocus], I get the following error:


*** Uncaught exception: <NSInternalInconsistencyException> Error (1002) creating CGSWindow

The stack crawl is:

#0 0x9282447f in _NSRaiseError ()
#1 0x9284b23f in +[NSException raise:format:] ()
#2 0x932d22ae in _NXCreateWindow ()
#3 0x932d209a in CreateWindowNamed ()
#4 0x932d1cef in NewCacheWindowInfo ()
#5 0x932d1847 in _NXAllocateImageCache ()
#6 0x932d0f8a in -[NSCachedImageRep _initWithSize:depth:separate:alpha:allowDeep:] ()
#7 0x932d6cd3 in -[NSImage _focusOnCache:] ()
#8 0x932d698e in -[NSImage _cacheRepresentation:stayFocused:] ()
#9 0x932d689d in -[NSImage _lockFocusOnRep:] ()
#10 0x932d0d68 in -[NSImage lockFocus] ()
#11 0x003cb966 in my program


Has anyone seen this before? Any ideas?

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40positivespinmedia.com


This email sent to email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >NSImage lockFocus throws exception? (From: John Stiles <email@hidden>)
 >Re: NSImage lockFocus throws exception? (From: John Pannell <email@hidden>)

  • Prev by Date: Re: How can I combine 2 data buffers?
  • Next by Date: imageNamed cannot load an image
  • Previous by thread: Re: NSImage lockFocus throws exception?
  • Next by thread: Re: NSImage lockFocus throws exception?
  • Index(es):
    • Date
    • Thread