public static int GetArrayBufferSize(Array buffer) { if (buffer == null) { throw new ArgumentNullException("buffer"); } int elementSize = WicUtility.GetElementSize(buffer); return(elementSize * buffer.Length); }
public static int GetArrayStride(Array buffer, int width, int height) { if (width <= 0) { throw new ArgumentOutOfRangeException("width"); } if (height <= 0) { throw new ArgumentOutOfRangeException("height"); } int elementSize = WicUtility.GetElementSize(buffer); return(elementSize * width); }