Debashis Debashis - 2 years ago 114
Objective-C Question

How do I take a "screenshot" of an NSView?

I need to take the contents of an

and put them in an
, for an experimental project. Is this possible? I did some Googling, tried two methods that I found - but they didn't really work. Any suggestions?

Answer Source
[[NSImage alloc] initWithData:[view dataWithPDFInsideRect:[view bounds]]];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download