From 24477473858d3009a289f1b860f6ac3edcedc860 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sat, 23 Dec 2023 23:19:00 +0100 Subject: [PATCH] Fixed ImageRow.CopyTo --- ScreenCapture.NET/Model/Image.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ScreenCapture.NET/Model/Image.cs b/ScreenCapture.NET/Model/Image.cs index 4cd6bf1..3197676 100644 --- a/ScreenCapture.NET/Model/Image.cs +++ b/ScreenCapture.NET/Model/Image.cs @@ -269,7 +269,7 @@ public sealed class Image : IImage if (destination == null) throw new ArgumentNullException(nameof(destination)); if (destination.Length < SizeInBytes) throw new ArgumentException("The destination is too small to fit this image.", nameof(destination)); - _buffer.AsSpan(_start, SizeInBytes).CopyTo(destination); + MemoryMarshal.Cast(_buffer).Slice(_start, _length).CopyTo(MemoryMarshal.Cast(destination)); } ///