Ejemplo n.º 1
0
 /// <summary>
 /// Возвращает прямоугольник по координатам
 /// </summary>
 /// <param name="coordinates"></param>
 /// <returns></returns>
 static private Rectangle GetCorrectRectangle(MouseRectangle coordinates)
 {
     return(new Rectangle(
                Math.Min(coordinates.First.X, coordinates.Second.X),
                Math.Min(coordinates.First.Y, coordinates.Second.Y),
                Math.Abs(coordinates.First.X - coordinates.Second.X),
                Math.Abs(coordinates.First.Y - coordinates.Second.Y)));
 }
Ejemplo n.º 2
0
        static private Image ScreenShot(MouseRectangle coordinates)
        {
            System.Drawing.Image BM = Pranas.ScreenshotCapture.TakeScreenshot();

            BM = CutImage(new Bitmap(BM), GetCorrectRectangle(coordinates));

            return(BM);
        }
Ejemplo n.º 3
0
 private void CursorRectangle_CompleteInit()
 {
     MainWindowVM.ThreadsControl.Start(ShowTextNotification, this.CursorRectangle);
     this.CursorRectangle = new MouseRectangle();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// x0,y0,x1,y1 are screen coordinates of text
 /// </summary>
 public ScreenText(MouseRectangle coordinates) : base()
 {
     text =
         TextFromImage(ScreenShot(coordinates));
 }
Ejemplo n.º 5
0
 public NotificatorScreenText()
 {
     this.CursorRectangle = new MouseRectangle();
     ActivatorEvent      += NotificatorScreenText_ActivatorEvent;
     DeactivatorEvent    += NotificatorScreenText_DeactivatorEvent;
 }