public VmClient() { var vm_title = "Windows81 [Running] - Oracle VM VirtualBox"; var handle = DirectGamer.FindWindow(null, vm_title); if (handle == IntPtr.Zero) { throw new Exception("Окно не найдено"); } DirectGamer.RECT rect; DirectGamer.GetWindowRect(handle, out rect); this.GameScreenRect = new System.Drawing.Rectangle(rect.Left + vm_left, rect.Top + vm_top, rect.Right - rect.Left - vm_right - vm_left, rect.Bottom - rect.Top - vm_bottom - vm_top); }
public System.Drawing.Bitmap Screenshot() { return(DirectGamer.GetScreenImage(GameScreenRect)); }