public static void Run() { list = new List <Bitmap>(); IntPtr hWnd = OtherFunctions.GetFocusedWindow(); Window.Normalize(hWnd); Window.SetFocused(hWnd); System.Threading.Thread.Sleep(1000); bmp = Desktop.Screenshot(); bmp = Tools.Crop(bmp, new Rectangle( Window.GetLocation(hWnd).X, Window.GetLocation(hWnd).Y, Window.GetSize(hWnd).Width, Window.GetSize(hWnd).Height )); temp = new Bitmap(bmp); mask = new Mask(hWnd, bmp); Load(); Display(); mask.Dispose(); }
public static void Run() { IntPtr hWnd = OtherFunctions.GetFocusedWindow(); Window.Normalize(hWnd); Window.SetFocused(hWnd); System.Threading.Thread.Sleep(1000); Bitmap screenshot = Desktop.Screenshot(); screenshot = Tools.Crop(screenshot, new Rectangle( Window.GetLocation(hWnd).X, Window.GetLocation(hWnd).Y, Window.GetSize(hWnd).Width, Window.GetSize(hWnd).Height )); Mask layer = new Mask(hWnd, screenshot); // The actual blurring. for (int i = 0; i < 10; i++) { screenshot = Filter.BlurFast(screenshot); System.Threading.Thread.Sleep(100); layer.Picture.Image = screenshot; layer.Picture.Update(); } Window.Close(hWnd); System.Threading.Thread.Sleep(100); Application.Run(); }
/// <summary> /// Begin motion detection. /// </summary> /// <param name="frames">The number of recent frames to keep track of.</param> /// <param name="quality">The quality of the display.</param> public static void Run(int frames, Quality quality) { hWnd = OtherFunctions.GetFocusedWindow(); SetQuality(quality); LoadForm(); MotionDetectorLoop(frames); }
public static void Run() { IntPtr hWnd = OtherFunctions.GetFocusedWindow(); Window.Normalize(hWnd); Window.SetFocused(hWnd); System.Threading.Thread.Sleep(1000); Bitmap screenshot = Desktop.Screenshot(); screenshot = Tools.Crop(screenshot, new Rectangle( Window.GetLocation(hWnd).X, Window.GetLocation(hWnd).Y, Window.GetSize(hWnd).Width, Window.GetSize(hWnd).Height )); screenshot = Effect.Invert(screenshot); Mask layer = new Mask(hWnd, screenshot); Window.Close(hWnd); System.Threading.Thread.Sleep(100); screenshot.Dispose(); Application.Run(); }
public static void Run() { hWnd = OtherFunctions.GetFocusedWindow(); blankBitmap = ImageProcessing.Tools.BlankBitmap(Window.GetSize(hWnd).Width, Window.GetSize(hWnd).Height * 2); for (int x = 0; x < blankBitmap.Width; x++) { for (int y = 0; y < blankBitmap.Height; y++) { blankBitmap.SetPixel(x, y, Color.FromArgb(85, 255, 0)); } } mask = new Mask(hWnd, blankBitmap); mask.Height *= 2; mask.AllowTransparency = true; mask.TransparencyKey = Color.FromArgb(85, 255, 0); mask.Picture.BackColor = Color.FromArgb(85, 255, 0); mask.BringToFront(); System.Threading.Thread.Sleep(1000); point = Window.GetLocation(hWnd); size = Window.GetSize(hWnd); LoadColumns(hWnd); stretch = new KeyValuePair <int, int> [columns.Length]; for (int i = 0; i < stretch.Length; i++) { stretch[i] = new KeyValuePair <int, int>(0, 0); } for (int i = 0; i < size.Height; i++) { Bitmap temp = (Bitmap)blankBitmap.Clone(); for (int j = 0; j < columns.Length; j++) { Bitmap slice = new Bitmap(1, size.Height + stretch[j].Value); slice = ImageProcessing.Tools.Resize(columns[j], 1, size.Height + stretch[j].Value); ImageProcessing.Tools.Copy(temp, slice, j, 0); } mask.Picture.Image = temp; mask.Picture.Update(); Window.Close(hWnd); for (int k = 0; k < 20; k++) { UpdateStrech(); } System.Threading.Thread.Sleep(10); } }
public static void Run() { IntPtr hWnd = OtherFunctions.GetFocusedWindow(); Window.Normalize(hWnd); Window.SetFocused(hWnd); System.Threading.Thread.Sleep(1000); Bitmap screenshot = Desktop.Screenshot(); screenshot = Tools.Crop(screenshot, new Rectangle( Window.GetLocation(hWnd).X, Window.GetLocation(hWnd).Y, Window.GetSize(hWnd).Width, Window.GetSize(hWnd).Height )); Mask layer = new Mask(hWnd, screenshot); Window.Close(hWnd); System.Threading.Thread.Sleep(100); Bitmap resized = new Bitmap(screenshot); for (double i = 1; i > 0.1; i -= 0.02) { resized.Dispose(); resized = Tools.Resize( screenshot, (int)(screenshot.Width * i), (int)(screenshot.Height * i) ); layer.Picture.Image = resized; layer.Size = resized.Size; layer.Picture.Update(); layer.Location = new Point( layer.Location.X + (int)(screenshot.Width * 0.02 / 2), layer.Location.Y + (int)(screenshot.Height * 0.02 / 2) ); System.Threading.Thread.Sleep(10); } Application.Run(); }
public static void RunMovie() { int[] array = new int[3]; array[0] = 147; array[1] = 147; array[2] = 255; IntPtr hWnd = OtherFunctions.GetFocusedWindow(); Bitmap bmp = Window.Screenshot(hWnd); Mask mask = new Mask(hWnd, bmp); Window.EnableMouseTransparency(mask.Handle); while (true) { mask.Picture.Image = Effect.Threshold(Window.Screenshot(hWnd), array); mask.Update(); Thread.Sleep(1); } }
public static void Run(int thresholds) { if (thresholds < 1 || thresholds > 255) { throw new Exception("Threshold must be 1-255."); } IntPtr hWnd = OtherFunctions.GetFocusedWindow(); System.Threading.Thread.Sleep(100); Window.SetFocused(hWnd); System.Threading.Thread.Sleep(100); Bitmap screenshot = Window.Screenshot(hWnd); if (thresholds <= 1) { screenshot = Effect.Threshold(screenshot); } else { int[] array = new int[thresholds]; int count = 0; for (int j = 0; j < array.Length; j++) { count += (255 / thresholds); array[j] = count; } screenshot = Effect.Threshold(screenshot, array); } Mask mask = new Mask(hWnd, screenshot); mask.TransparencyKey = Color.White; System.Threading.Thread.Sleep(100); Window.Close(hWnd); Application.Run(); }
public static void Run() { IntPtr hWnd = OtherFunctions.GetFocusedWindow(); Window.Normalize(hWnd); Window.SetFocused(hWnd); System.Threading.Thread.Sleep(1000); Bitmap screenshot = Desktop.Screenshot(); screenshot = Tools.Crop(screenshot, new Rectangle( Window.GetLocation(hWnd).X, Window.GetLocation(hWnd).Y, Window.GetSize(hWnd).Width, Window.GetSize(hWnd).Height )); mask = new Mask(hWnd, screenshot); Window.Close(hWnd); LoadWidth(0, mask.Width - 1); LoadHeight(0, mask.Height - 1); Application.Run(); //Display(); }