How do I make a thumbnail view (It\'s not image) form a custom view(NSView)?
If the custom NSView\'s content changed that thumbnail view will be changed.
It\
I suggest you do some more Googling next time, and tell us what you have tried, but I'll answer anyways:
You may want to use NSView
's -(void)cacheDisplayInRect:toBitmapImageRep:
to create an NSImage
which contains the thumbnail. The following is what I use in an app of mine:
- (NSImage *)snapshotForRect:(NSRect)destinationRect {
NSView *view = ... // view you want thumbnail of
NSBitmapImageRep *imageRep = [view bitmapImageRepForCachingDisplayInRect:destinationRect];
[view cacheDisplayInRect:destinationRect toBitmapImageRep:imageRep];
NSImage *renderedImage = [[NSImage alloc] initWithSize:[imageRep
size]];
[renderedImage addRepresentation:imageRep];
return [renderedImage autorelease];
}
Or use the variety of other methods available.
How do I take a "screenshot" of an NSView?