如何制作缩略图视图(不是图像)形成自定义视图(NSView)?
如果自定义 NSView 的内容发生更改,缩略图视图也会发生更改。
看起来像ibook作者。
谢谢大家。
https://plus.google.com/u/0/photos/114755931805273493604/albums/5753531972174581009
我建议你下次再用谷歌搜索一下,然后告诉我们你尝试过什么,但我还是会回答:
您可能想使用NSView
's -(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];
}
或者使用各种其他可用的方法。
如何截取 NSView 的“屏幕截图”?
Google
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)