Skip to content

Commit 2447747

Browse files
committed
Fixed ImageRow.CopyTo
1 parent b6132a4 commit 2447747

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ScreenCapture.NET/Model/Image.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public void CopyTo(in Span<byte> destination)
269269
if (destination == null) throw new ArgumentNullException(nameof(destination));
270270
if (destination.Length < SizeInBytes) throw new ArgumentException("The destination is too small to fit this image.", nameof(destination));
271271

272-
_buffer.AsSpan(_start, SizeInBytes).CopyTo(destination);
272+
MemoryMarshal.Cast<byte, TColor>(_buffer).Slice(_start, _length).CopyTo(MemoryMarshal.Cast<byte, TColor>(destination));
273273
}
274274

275275
/// <inheritdoc />

0 commit comments

Comments
 (0)