This documentation is for the old version. Go to the latest Graphics Mill docs

GdiGraphics.Lock Method

Locks the object.

Namespace: Aurigma.GraphicsMill.Drawing
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

Visual Basic
Public Overrides Sub Lock
C#
public override void Lock()

Implements

ILockable.Lock()

Remarks

After calling this method this object is not accessible from any other thread (until Unlock() is called). You can safely check Locked property to ensure if object is locked.

When you access the object which has been locked, the thread stops and waits until it become unlocked. Using property Timeout you can specify how much time to wait.

Note

All GdiGraphics method and properties already uses Lock()/Unlock() methods to provide thread safety. You need call these methods manually only if you manipulate the objects manually, or if you inherit your own class from ILockable interface.

See Also

Reference