示例#1
0
        public static int GetArrayBufferSize(Array buffer)
        {
            if (buffer == null)
            {
                throw new ArgumentNullException("buffer");
            }
            int elementSize = WicUtility.GetElementSize(buffer);

            return(elementSize * buffer.Length);
        }
示例#2
0
        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);
        }