コード例 #1
0
ファイル: X11Capture.cs プロジェクト: tylerrbrown/Remotely
 public void Init()
 {
     try
     {
         var defaultScreen = LibX11.XDefaultScreen(Display);
         SetSelectedScreen(defaultScreen);
         CurrentFrame  = new Bitmap(CurrentScreenBounds.Width, CurrentScreenBounds.Height, PixelFormat.Format32bppArgb);
         PreviousFrame = new Bitmap(CurrentScreenBounds.Width, CurrentScreenBounds.Height, PixelFormat.Format32bppArgb);
     }
     catch (Exception ex)
     {
         Logger.Write(ex);
     }
 }
コード例 #2
0
        public void SendMouseMove(double percentX, double percentY, Viewer viewer)
        {
            try
            {
                InitDisplay();

                var screenBounds = viewer.Capturer.CurrentScreenBounds;
                LibXtst.XTestFakeMotionEvent(Display,
                                             LibX11.XDefaultScreen(Display),
                                             screenBounds.X + (int)(screenBounds.Width * percentX),
                                             screenBounds.Y + (int)(screenBounds.Height * percentY),
                                             0);
                LibX11.XSync(Display, false);
            }
            catch (Exception ex)
            {
                Logger.Write(ex);
            }
        }