Search code examples
objective-ccocoansviewnsimage

How to create an NSImage from an NSView that isn't completely visible?


I have an NSView in an NSScrollView that I want to create an NSImage from. Because it's in an NSScrollView it's not always completely visible, and it can be even bigger that the screen's size. Can anyone help me? Thanks.


Solution

  • [NSView cacheDisplayInRect:toBitmapImageRep:]