private void NotifyScreenChanged(BitmapContainer bitmapContainer) { if (this.ScreenCaptured != null) { this.ScreenCaptured(this, new GenericDataEventArgs <BitmapContainer>(bitmapContainer)); } }
private ScreenCapturer(int screenIndex) { this.screenIndex = screenIndex; this.screenCaptureTimer = new Timer(); this.screenCaptureTimer.Interval = SCREEN_CAPTURE_INTERVAL; this.screenCaptureTimer.Elapsed += (sender, e) => { BitmapContainer bitmapContainer = null; lock (this.bitmapLock) { bitmapContainer = this.CaptureBitmap(); } this.NotifyScreenChanged(bitmapContainer); }; this.mouseCaptureTimer = new Timer(); this.mouseCaptureTimer.Interval = MOUSE_CAPTURE_INTERVAL; this.mouseCaptureTimer.Elapsed += (sender, e) => { var bitmapContainer = this.CaptureMouse(); this.NotifyScreenChanged(bitmapContainer); }; }
public IBitmapContainer AddBitmapContainer(string filename, int x, int y) { BitmapContainer bitmapContainer = new BitmapContainer(this); bitmapContainer.Load(filename); bitmapContainer.Left = x; bitmapContainer.Top = y; AddElement(bitmapContainer); return bitmapContainer; }
public IBitmapContainer AddBitmapContainer(Bitmap bitmap, int x, int y) { BitmapContainer bitmapContainer = new BitmapContainer(this); bitmapContainer.Bitmap = bitmap; bitmapContainer.Left = x; bitmapContainer.Top = y; AddElement(bitmapContainer); return bitmapContainer; }