カスタムビュー(NSView)からサムネイルビュー(画像ではない)を作成するにはどうすればよいですか?
カスタムNSViewのコンテンツが変更された場合、そのサムネイルビューも変更されます。
ibookauthorのようです。
皆さんありがとう。
https://plus.google.com/u/0/photos/114755931805273493604/albums/5753531972174581009
カスタムビュー(NSView)からサムネイルビュー(画像ではない)を作成するにはどうすればよいですか?
カスタムNSViewのコンテンツが変更された場合、そのサムネイルビューも変更されます。
ibookauthorのようです。
皆さんありがとう。
https://plus.google.com/u/0/photos/114755931805273493604/albums/5753531972174581009
次回はもう少しグーグルをして、何を試したか教えてください。とにかく答えます。
を使用して、サムネイルを含むを作成することをNSView
お勧めします。以下は私のアプリで使用するものです:-(void)cacheDisplayInRect:toBitmapImageRep:
NSImage
- (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];
}
または、利用可能な他のさまざまな方法を使用します。