Stop scrolling capture on first combine fail

This commit is contained in:
Jaex 2024-04-07 16:23:57 +03:00
parent 5ebce2f652
commit c49d641972
1 changed files with 13 additions and 4 deletions

View File

@ -130,7 +130,17 @@ namespace ShareX.ScreenCaptureLib
if (lastScreenshot != null)
{
Result = await CombineImagesAsync(Result, lastScreenshot);
Bitmap newResult = await CombineImagesAsync(Result, lastScreenshot);
if (newResult != null)
{
Result?.Dispose();
Result = newResult;
}
else
{
break;
}
}
if (stopRequested)
@ -294,12 +304,11 @@ namespace ShareX.ScreenCaptureLib
new Rectangle(0, matchIndex + 1, currentImage.Width, matchHeight), GraphicsUnit.Pixel);
}
result.Dispose();
result = newResult;
return newResult;
}
}
return result;
return null;
}
}
}