Show / Hide Table of Contents

Class IconImageCache

Gets images as System.Drawing.Bitmap of same logical size to be displayed as icons. Can get file icons or load images from files etc.

public sealed class IconImageCache : IDisposable
Remarks

Uses memory cache and optionally file cache to avoid loading same image multiple times. Getting images from cache is much faster.

Bitmap objects retrieved by this class are stored in memory cache. Don't dispose them before disposing the IconImageCache object. Usually don't need to dispose these Bitmap objects explicitly (GC will do it).

Thread-safe.


Namespace: Au.More
Assembly: Au.dll
Inheritance
object
IconImageCache

Constructors

Name Description
IconImageCache(int, string)

Properties

Name Description
Common

Common cache for icons of size 16. Used by menus, toolbars and editor.

ImageSize

Width and height of images.

Methods

Name Description
Clear(bool)

Clears the cache (removes images from memory cache and file cache).

ClearAll(bool)

Clears caches of all IconImageCache instances of this or all processes. Redraws (asynchronously) all visible windows of these processes.

CommonOfSize(int)

Common cache for icons of given size. Used by menus and toolbars if custom MTBase.ImageSize.

Dispose()

Removes images from memory cache (but does not dispose) and makes this object unusable. Optional.

Get(string, int, bool, Action<string, Exception>)

Gets image from cache or file etc.

Events

Name Description
Cleared

When the cache cleared.