---
title: restoreCachedImage()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nswindow/restorecachedimage()
---

# restoreCachedImage()

Splices the window’s cached image rectangles, if any, back into its raster image (and buffer if it has one), undoing the effect of any drawing performed within those areas since they were established using cacheImage(in:).

## Declaration

```swift
func restoreCachedImage()
```

## Discussion

Discussion You must invoke flush() after this method to guarantee proper redisplay. An NSWindow object automatically discards its cached image rectangles when it displays.

## See Also

### Related Documentation

- [display()](appkit/nswindow/display().md)

### Methods

- [gState()](appkit/nswindow/gstate().md)
- [canStoreColor()](appkit/nswindow/canstorecolor().md)
- [enableFlushing()](appkit/nswindow/enableflushing().md)
- [disableFlushing()](appkit/nswindow/disableflushing().md)
- [flush()](appkit/nswindow/flush().md)
- [flushIfNeeded()](appkit/nswindow/flushifneeded().md)
- [menuChanged(_:)](appkit/nswindow/menuchanged(_:).md)
- [cacheImage(in:)](appkit/nswindow/cacheimage(in:).md)
- [discardCachedImage()](appkit/nswindow/discardcachedimage().md)
- [useOptimizedDrawing(_:)](appkit/nswindow/useoptimizeddrawing(_:).md)
- [init(windowRef:)](appkit/nswindow/init(windowref:).md)
