void __fastcall Lock();
Prevents other threads from drawing on the canvas.
Use Lock in a multithreaded application to prevent other threads from drawing on the canvas. Lock prevents other cooperating threads in the application from executing until the Unlock method is called. Nested calls to Lock increment the LockCount property so that the canvas is not unlocked until the last lock is released.
In multithreaded applications that use Lock to protect a canvas, all calls that use the canvas must be protected by a call to Lock. Any thread that does not lock the canvas before using it introduces potential bugs.