Пример #1
0
 void Snapper_OnScreenShot(object sender, CoreEventArgs e)
 {
     trayIcon.BalloonTipTitle = "ScreenSnapper";
     trayIcon.BalloonTipText  = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss") + " > " + e.Message;
     lastScreenshotPath       = e.ScreenshotPath;
     trayIcon.ShowBalloonTip(1000);
 }
Пример #2
0
 private void SendShotFailedEvent()
 {
     if (OnScreenShotFailed != null)
     {
         CoreEventArgs args = new CoreEventArgs();
         args.Message = "Capture impossible...";
         OnScreenShotFailed(this, args);
     }
 }
Пример #3
0
 private void SendShotEvent(string filePath)
 {
     if (OnScreenShot != null)
     {
         CoreEventArgs args = new CoreEventArgs();
         args.Message        = "Capture effectuée...";
         args.ScreenshotPath = filePath;
         OnScreenShot(this, args);
     }
 }
Пример #4
0
        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);
        }
Пример #5
0
 void Snapper_OnTooltipWanted(object sender, CoreEventArgs e)
 {
     trayIcon.BalloonTipTitle = "ScreenSnapper";
     trayIcon.BalloonTipText  = e.Message;
     trayIcon.ShowBalloonTip(1000);
 }