Instance Method


Draws the specified area of the view, and its descendants, into a provided bitmap-representation object.


- (void)cacheDisplayInRect:(NSRect)rect toBitmapImageRep:(NSBitmapImageRep *)bitmapImageRep;



A rectangle defining the region to be drawn into bitmapImageRep.


An NSBitmapImageRep object. For pixel-format compatibility, bitmapImageRep should have been obtained from bitmapImageRepForCachingDisplayInRect:.


You are responsible for initializing the bitmap to the desired configuration before calling this method. However, once initialized, you can reuse the same bitmap multiple times to refresh the cached copy of your view’s contents.

The bitmap produced by this method is transparent (that is, has an alpha value of 0) wherever the view and its descendants do not draw any content.

See Also


- updateLayer

Updates the view’s content by modifying its underlying layer.

- drawRect:

Overridden by subclasses to draw the view’s image within the specified rectangle.


A Boolean value indicating whether drawing commands will produce any results.


A Boolean value indicating whether the view can draw its contents on a background thread.


The portion of the view that is not clipped by its superviews.

- getRectsBeingDrawn:count:

Returns by indirection a list of nonoverlapping rectangles that define the area the view is being asked to draw in drawRect:.

- needsToDrawRect:

Returns a Boolean value indicating whether the specified rectangle intersects any part of the area that the view is being asked to draw.


A Boolean value indicating whether AppKit’s default clipping behavior is in effect.

- bitmapImageRepForCachingDisplayInRect:

Returns a bitmap-representation object suitable for caching the specified portion of the view.