Table of Contents

Method CopyPixelsFrom

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

CopyPixelsFrom(nint, long)

Copies row data from an unmanaged buffer that has its own row stride into this matrix. Performs no pixel-format conversion; the source buffer must already match this matrix's channel layout (convert with Cv2.CvtColor after the copy if it doesn't).

public void CopyPixelsFrom(nint src, long srcStep)

Parameters

src nint

Pointer to the first byte of the source buffer.

srcStep long

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

Exceptions

ArgumentException

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