Skip to content

Commit

Permalink
尝试 修复 截图错误
Browse files Browse the repository at this point in the history
优化 报错显示
  • Loading branch information
MakesYT committed Aug 4, 2024
1 parent 7962706 commit 6ed1a7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Core.Window/ScreenCaptureByDx11.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public class DisposableTool(Action busySetter) : IDisposable
}

OutduplFrameInfo outduplFrameInfo = new OutduplFrameInfo();
Thread.Sleep(10);
if (outputDuplication->AcquireNextFrame(2000, &outduplFrameInfo, &desktopResource) != 0 ||
Thread.Sleep(20);
if (outputDuplication->AcquireNextFrame(3000, &outduplFrameInfo, &desktopResource) != 0 ||
outduplFrameInfo.LastPresentTime == 0)
{
throw new Exception("Failed to acquire next frame");
Expand Down Expand Up @@ -218,7 +218,7 @@ public class DisposableTool(Action busySetter) : IDisposable
}
catch (Exception e)
{
log.Error(e);
log.Error("错误", e);
}
finally
{
Expand Down
2 changes: 1 addition & 1 deletion Core/SDKs/Services/Config/KitopiaConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public class KitopiaConfig : ConfigBase
{
log.Error(e.Exception);
ServiceManager.Services.GetService<IErrorWindow>()!.ShowErrorWindow(
"截图失败", e.Exception.Message);
"截图失败", e.Exception.Message + e.Exception.StackTrace);
}
});
};
Expand Down

0 comments on commit 6ed1a7f

Please sign in to comment.