Skip to main content
A newer version of this page is available. .

GraphicsCache Class

Provides methods to paint on drawing surfaces in GDI+ and DirectX modes (see DirectX hardware acceleration). Provides storage for pens, fonts and brushes.

Namespace: DevExpress.Utils.Drawing

Assembly: DevExpress.Utils.v18.1.dll

Declaration

public class GraphicsCache :
    IGraphicsCache,
    IDisposable

Remarks

The GraphicsCache class provides methods to obtain pens, fonts and brushes with specified settings. When a method is called, it first checks whether the object with the requested parameters is already stored within an internal hash table. If so, the located object is returned. Otherwise a new object with the requested parameters is created and written to the corresponding hash table.

The GraphicsCache object maintains four hash tables used to store pens, fonts and solid and linear gradient brushes. You can obtain corresponding objects via the GraphicsCache.GetPen, GraphicsCache.GetFont, GraphicsCache.GetSolidBrush and GraphicsCache.GetGradientBrush methods respectively. Note that all mentioned hash tables are initially empty.

When DirectX hardware acceleration is activated, the methods provided by the GraphicsCache object allow you to paint various graphics primitives.

The following code snippets (auto-collected from DevExpress Examples) contain references to the GraphicsCache class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Inheritance

Object
GraphicsCache
See Also