Creating an NSImage of a View and its Contents

2010-12-21 Thread Stephen Blinkhorn
Hi all, I'm trying to capture a view and its contents as an NSImage which I can subsequently draw in the view. The idea is that I'm trying to 'freeze' the view's content (custom sliders, buttons, menus etc) and present this image in the view. I'm getting mixed results when attempting to

Re: Creating an NSImage of a View and its Contents

2010-12-21 Thread Corbin Dunn
Hi Stephen, This was done in the AnimatedTableView demo app available on the dev site. Check it out and let me know if you need pointing to the particular part of code that does it. corbin On Dec 21, 2010, at 12:11 PM, Stephen Blinkhorn wrote: Hi all, I'm trying to capture a view and its

Re: Creating an NSImage of a View and its Contents

2010-12-21 Thread Corbin Dunn
I'll just copy the code here for you: NSRect visibleRect = [_oldContentView visibleRect]; NSBitmapImageRep *imageRep = [_oldContentView bitmapImageRepForCachingDisplayInRect:visibleRect]; [_oldContentView cacheDisplayInRect:visibleRect toBitmapImageRep:imageRep];

Re: Creating an NSImage of a View and its Contents

2010-12-21 Thread Stephen Blinkhorn
On 21 Dec 2010, at 15:10, Corbin Dunn wrote: I'll just copy the code here for you: NSRect visibleRect = [_oldContentView visibleRect]; NSBitmapImageRep *imageRep = [_oldContentView bitmapImageRepForCachingDisplayInRect:visibleRect]; [_oldContentView cacheDisplayInRect:visibleRect