Version

GetCachedGraphics Method (DrawUtility)

Called to get a graphics object suitable for doing metrics calculations only.
Syntax
'Declaration
 
Public Shared Function GetCachedGraphics( _
   ByVal control As Control _
) As Graphics
public static Graphics GetCachedGraphics( 
   Control control
)

Parameters

control
The control to base the graphics on.

Return Value

A graphics object suitable for doing metrics calculations only. This graphics object shouldn't be rendered on.
Remarks

Do NOT call the Dispose method on the graphics object returned from this method.

Instead, each call to this method should be paired with a call to ReleaseCachedGraphics.

During graphics caching calls to GetCachedGraphics will return a single cached graphics object and calls to ReleaseCachedGraphics will be ignored.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also