Capture full screen after capturer init.

This commit is contained in:
Jared Goodwin 2020-08-16 12:44:15 -07:00
parent 24ea1488e5
commit f46da0f7f1
4 changed files with 14 additions and 3 deletions

View File

@ -119,8 +119,12 @@ namespace Remotely.Desktop.Core.Services
viewer.ThrottleIfNeeded();
previousFrame?.Dispose();
previousFrame = (Bitmap)currentFrame?.Clone();
if (currentFrame != null)
{
previousFrame?.Dispose();
previousFrame = (Bitmap)currentFrame.Clone();
}
currentFrame?.Dispose();
currentFrame = viewer.Capturer.GetNextFrame();

View File

@ -21,6 +21,11 @@ namespace Remotely.Desktop.Core.Utilities
public static Rectangle GetDiffArea(Bitmap currentFrame, Bitmap previousFrame, bool captureFullscreen)
{
if (currentFrame == null || previousFrame == null)
{
return Rectangle.Empty;
}
if (captureFullscreen)
{
return new Rectangle(new Point(0, 0), currentFrame.Size);

View File

@ -24,7 +24,7 @@ namespace Remotely.Desktop.Linux.Services
public event EventHandler<Rectangle> ScreenChanged;
public bool CaptureFullscreen { get; set; }
public bool CaptureFullscreen { get; set; } = true;
public Rectangle CurrentScreenBounds { get; private set; }
public IntPtr Display { get; private set; }
public string SelectedScreen { get; private set; }
@ -81,6 +81,7 @@ namespace Remotely.Desktop.Linux.Services
{
try
{
CaptureFullscreen = true;
x11Screens.Clear();
for (var i = 0; i < GetScreenCount(); i++)

View File

@ -116,6 +116,7 @@ namespace Remotely.Desktop.Win.Services
public void Init()
{
CaptureFullscreen = true;
InitBitBlt();
InitDirectX();