Table of Contents

Method CreateDrawingContext

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

CreateDrawingContext()

Creates the Graphics for the control.

Graphics CreateDrawingContext()

Returns

Graphics

The Graphics for the control.

Remarks

The Graphics object that you retrieve through the CreateDrawingContext() method should not normally be retained after the current UI event has been processed, because anything painted with that object will be erased with the next paint event. Therefore you cannot cache the Graphics object for reuse, except to use non-visual methods like MeasureText(string, Font). Instead, you must call CreateDrawingContext() every time that you want to use the Graphics object, and then call its Dispose() when you are finished using it.