示例#1
0
        private void btnScreen_Click(object sender, EventArgs e)
        {
            ScreenShot screenShot = ScreenGrabber.Win32ScreenShot(2.0);

            Debug.WriteLine($"Size: {screenShot.Width} x {screenShot.Height} Length: {screenShot.Bytes.Length}");
            pbScreen.Image = CreateBitmapFromScreenShot(screenShot);
        }
示例#2
0
文件: Program.cs 项目: Dr1N/ScreenRD
 /// <summary>
 /// Create Screen Shots
 /// </summary>
 static void ScreenProc()
 {
     Console.WriteLine("Screen Thread running...");
     while (true)
     {
         if (stopwatch.IsRunning == false)
         {
             stopwatch.Start();
         }
         ScreenShot screenShotData = ScreenGrabber.Win32ScreenShot(2.0);
         lock (locker)
         {
             buffer = screenShotData.Bytes;
         }
         width  = screenShotData.Width;
         height = screenShotData.Height;
         PrintFps();
         Thread.Sleep(sleepTime);
     }
 }