Re: Can't cache image
Re: Can't cache image
- Subject: Re: Can't cache image
- From: Greg Titus <email@hidden>
- Date: Fri, 21 Mar 2003 12:46:50 -0800
On Friday, March 21, 2003, at 12:25 PM, Jan Van Tol wrote:
I've had this same problem, and I narrowed it down to simply creating
a very large NSImage, then locking focus on it. I can have the exact
same code start to give the can't cache image error simply by initing
a larger image.
If anyone knows of a workaround, I would love to hear it.
Nope, there isn't really a workaround that I am aware of. When you
lockFocus on an NSImage, it creates an NSCachedImageRep, which is
really a window that just happens to not be on the screen. So when you
create a very large NSImage and lockFocus, AppKit tries to make a very
large window, and fails.
The limit, last time I checked, was somewhere around a size of 2500 in
either width or height. (Thus a 3000x1 image will fail, even though it
has the same number of pixels as a 30x100 image, which will succeed.)
- Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.