3

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.

2 Answers2

6

[NSView cacheDisplayInRect:toBitmapImageRep:]

kperryua
  • 10,524
  • 1
  • 38
  • 24
1

Alternatively, depending on what you need the image for, consider making a PDF of the view.

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370