I have a WPF application that has a list box of images. Right now I am using [`BitmapImage`](https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.imaging.bitmapimage?view=net-5.0) and [`BitmapCacheOption.OnLoad`](https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.imaging.bitmapcacheoption?view=net-5.0#System_Windows_Media_Imaging_BitmapCacheOption_OnLoad) to load the images.

The problem is that when there are a lot of images, the RAM usage sky rockets due to the size of the images.

How can I create thumbnail images of the originals to display in the list box?

It probably has to be cached since the image files in the directory may be deleted or modified while the application is running.