IKImageView to NSImage?
IKImageView to NSImage?
- Subject: IKImageView to NSImage?
- From: Jim Leno <email@hidden>
- Date: Thu, 03 Feb 2011 11:43:29 -0800
I have an IKIMageView inside of a scroll view that can be zoomed. I would like to be able to capture the visible portion of the image to an NSImage.
I've tried the following code example to create an image rep and then use that to create a new NSImage. I've tried it on the scroll view, the scroll clip view and the image view iself and none of them give me the portion of the image visible in the image view. The scroll view and clip view return an all white image, and the image view seems to return nothing.
[view lockFocus];
NSBitmapImageRep *bits = [[NSBitmapImageRep alloc] initWithFocusedViewRect: [view bounds]];
[view unlockFocus];
I know the image view has a valid image because I can ask for it and construct a new image from the CGImageRef, but that is the original, full size image, not the visible scaled portion.
Thanks in advance for any suggestions.
_______________________________________________
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