Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.2.dll

NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core

#Declaration

public class GraphicsCache :
    IGraphicsCache,
    IDisposable,
    ISkinProvider

#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.

#Inheritance

Object
GraphicsCache
See Also