diff --git a/BetterGenshinImpact/Core/Config/Global.cs b/BetterGenshinImpact/Core/Config/Global.cs index aac46322..a74e4178 100644 --- a/BetterGenshinImpact/Core/Config/Global.cs +++ b/BetterGenshinImpact/Core/Config/Global.cs @@ -5,7 +5,7 @@ namespace BetterGenshinImpact.Core.Config; public class Global { - public static string Version { get; } = "0.24.1"; + public static string Version { get; } = "0.24.2"; public static string StartUpPath { get; private set; } = AppContext.BaseDirectory; diff --git a/Fischless.GameCapture/Graphics/GraphicsCapture.cs b/Fischless.GameCapture/Graphics/GraphicsCapture.cs index 1ddbe861..02336f39 100644 --- a/Fischless.GameCapture/Graphics/GraphicsCapture.cs +++ b/Fischless.GameCapture/Graphics/GraphicsCapture.cs @@ -46,7 +46,7 @@ public class GraphicsCapture : IGameCapture _captureFramePool = Direct3D11CaptureFramePool.Create(device, DirectXPixelFormat.B8G8R8A8UIntNormalized, 2, _captureItem.Size); - _captureFramePool.FrameArrived += OnFrameArrived; + // _captureFramePool.FrameArrived += OnFrameArrived; _captureSession = _captureFramePool.CreateCaptureSession(_captureItem); _captureSession.IsCursorCaptureEnabled = false; if (ApiInformation.IsWriteablePropertyPresent("Windows.Graphics.Capture.GraphicsCaptureSession", "IsBorderRequired")) @@ -109,29 +109,29 @@ public class GraphicsCapture : IGameCapture return null; } - // try - // { - // using var frame = _captureFramePool?.TryGetNextFrame(); - // - // if (frame == null) - // { - // return null; - // } - // - // return frame.ToBitmap(_region); - // } - // catch (Exception e) - // { - // Debug.WriteLine(e); - // } - // - // return null; - - if (_currentBitmap == null) + try { - return null; + using var frame = _captureFramePool?.TryGetNextFrame(); + + if (frame == null) + { + return null; + } + + return frame.ToBitmap(_region); } - return (Bitmap)_currentBitmap.Clone(); + catch (Exception e) + { + Debug.WriteLine(e); + } + + return null; + + // if (_currentBitmap == null) + // { + // return null; + // } + // return (Bitmap)_currentBitmap.Clone(); } public void Stop()