private void SetLastFrame(SimpleBitmap bmp) { lock (ImageProcessLock) { if (LastFrame != null && LastFrame.Locked) { LastFrame.Dispose(true); } LastFrame = bmp; } }