Theocacao
Leopard
Design Element
Comment on "Saving Cocoa View Contents to an Image File"
by Jon Hess — Oct 23
The -[NSView cacheDisplayInRect: ... ] method will be much more pleasing if your view isn't opaque. cacheDisplayInRect: will only draw your view and won't capture any of the views behind it. The lock focus and use a bitmap image rep technique will end up picking up any of the views that 'show through' your view from behind.

For example, the cacheDisplayInRect method on a push button will only grab the push button while the first method will get the push button and the window background pattern.
Back to "Saving Cocoa View Contents to an Image File"
Design Element

Copyright © Scott Stevenson 2004-2015