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.
by Jon Hess — Oct 23
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.