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(); }
static void Main(string[] args) { while (true) { DisplayMenu(); Console.Write("Input: "); int input = 0; bool inputIsInt = int.TryParse(Console.ReadLine(), out input); // I used if statements instead of switch deliberately. It is more readable. if (!inputIsInt) { Console.WriteLine("Invalid input."); } else if (input == 1) { WriteToDesktop.Run(); } else if (input == 2) { RotateDesktop.Run(); } else if (input == 3) { MeltScreen.Run(); } else if (input == 4) { OtherFunctions.ShakeMouse(); } else if (input == 5) { MouseSpam.Run(); } else if (input == 6) { MouseSpam.RunExtreme(); } else if (input == 7) { ShrinkWindow.Run(); } else if (input == 8) { HueShifter.Run(); } else if (input == 9) { MeltWindow.Run(); } else if (input == 10) { InvertWindow.Run(); } else if (input == 11) { Wavy.Run(); } else if (input == 12) { Scrambler.Run(); } else if (input == 13) { TraceWindow.Run(1); } else if (input == 14) { OtherFunctions.WindowShaker(); } else if (input == 15) { OtherFunctions.WindowShakerExtreme(); } else if (input == 16) { OtherFunctions.SetTitle(); } else if (input == 17) { OtherFunctions.ResizeBorders(); } else if (input == 18) { OtherFunctions.MouseTransparency(); } else if (input == 19) { OtherFunctions.Hide(); } else if (input == 20) { OtherFunctions.Show(); } else if (input == 21) { OtherFunctions.RemoveMenu(); } else if (input == 22) { OtherFunctions.DisableClose(); } else if (input == 23) { OtherFunctions.DisableMaximize(); } else if (input == 24) { OtherFunctions.DisableMinimize(); } else if (input == 25) { Painter.Run(); } else if (input == 26) { MotionDetector.Run(30, MotionDetector.Quality.High); } else if (input == 27) { RippleEffect.Run(); } else if (input == 28) { DesktopArt.Run(); } else if (input == 29) { WindowsAPI.Desktop.HideTaskBar(); } else if (input == 30) { WindowsAPI.Desktop.ShowTaskBar(); } else if (input == 0) { break; } } }