Skip to content

Commit f280166

Browse files
authored
Merge pull request #26 from DarthAffe/ImageFix
Fixed ImageRow.CopyTo
2 parents b6132a4 + 2447747 commit f280166

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)