void hk3_HotkeyPressed(object sender, System.EventArgs e) { switch (nbpress) { case 0: //affiche tooltip if (OnTooltipWanted != null) { CoreEventArgs args = new CoreEventArgs(); args.Message = "Souris en TopLeft puis F9"; OnTooltipWanted(this, args); } nbpress++; break; case 1: ShotZone = new Rectangle(); ShotZone.Location = Cursor.Position; nbpress++; if (OnTooltipWanted != null) { CoreEventArgs args = new CoreEventArgs(); args.Message = "Souris en BottomRight puis F9"; OnTooltipWanted(this, args); } break; case 2: ShotZone.Width = Cursor.Position.X - ShotZone.X; ShotZone.Height = Cursor.Position.Y - ShotZone.Y; Bitmap screenshot = ScreenShot.SpecificScreenShot(ShotZone); if (screenshot != null) { string filepath = Path.Combine(GetSavePath(), GetFileName()); screenshot.Save(filepath, ImageFormat.Png); SendShotEvent(filepath); } else { SendShotFailedEvent(); } nbpress = 0; break; } // Screen Zone //FirstClick = true; //HookManager.MouseClick += new MouseEventHandler(HookManager_MouseClick); }
void hk2_HotkeyPressed(object sender, System.EventArgs e) { // Active Window Bitmap screenshot = ScreenShot.ActiveWindowScreenShot(); if (screenshot != null) { string filepath = Path.Combine(GetSavePath(), GetFileName()); screenshot.Save(filepath, ImageFormat.Png); SendShotEvent(filepath); } else { SendShotFailedEvent(); } }