ToArray() public static method

public static ToArray ( IntPtr nativeData, int length ) : QuantumType[]
nativeData System.IntPtr
length int
return QuantumType[]
Example #1
0
        private QuantumType[] GetAreaUnchecked(int x, int y, int width, int height)
        {
            IntPtr pixels = _NativeInstance.GetArea(x, y, width, height);

            if (pixels == IntPtr.Zero)
            {
                throw new InvalidOperationException("Image contains no pixel data.");
            }

            int length = width * height * _Image.ChannelCount;

            return(QuantumConverter.ToArray(pixels, length));
        }