开发者

How to create an NSImage from an NSView that isn't completely visible?

开发者 https://www.devze.com 2023-01-22 12:34 出处:网络
I have an NSView in an NSScrollView that I want to create a开发者_StackOverflown NSImage from. Because it\'s in an NSScrollView it\'s not always completely visible, and it can be even bigger that the

I have an NSView in an NSScrollView that I want to create a开发者_StackOverflown NSImage from. Because it's in an NSScrollView it's not always completely visible, and it can be even bigger that the screen's size. Can anyone help me? Thanks.


[NSView cacheDisplayInRect:toBitmapImageRep:]


Alternatively, depending on what you need the image for, consider making a PDF of the view.

0

精彩评论

暂无评论...
验证码 换一张
取 消