Table of Contents

Method CopyPixelsTo

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

CopyPixelsTo(nint, long)

Copies this matrix's row data into an unmanaged buffer that has its own row stride, such as a UI framework's bitmap buffer. Handles submatrices and non-continuous matrices correctly. Performs no pixel-format conversion; convert the channel layout beforehand (e.g. via Cv2.CvtColor) if the destination expects a different channel order or count.

public void CopyPixelsTo(nint dst, long dstStep)

Parameters

dst nint

Pointer to the first byte of the destination buffer.

dstStep long

Number of bytes between the start of consecutive rows in the destination buffer. May be negative for bottom-up buffers (e.g. a negative-stride GDI+ BitmapData), in which case dst must still point at row 0.

Exceptions

ArgumentException

dst is a null pointer, this matrix has more than 2 dimensions, or the magnitude of dstStep is smaller than the row byte width of this matrix.