예제 #1
0
파일: Pi2.cs 프로젝트: habi/pi2
        /// <summary>
        /// Get pointer to data of this image.
        /// The pointer is valid until this image object is modified in Pi2.
        /// </summary>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <param name="depth"></param>
        /// <param name="dataType"></param>
        /// <returns></returns>
        public IntPtr GetData(out Int64 width, out Int64 height, out Int64 depth, out ImageDataType dataType)
        {
            IntPtr data = PiLib.GetImage(Pi.Handle, Name, out width, out height, out depth, out dataType);

            if (data == IntPtr.Zero || dataType == ImageDataType.Unknown)
            {
                throw new InvalidOperationException("Image " + Name + " is inaccessible because it has been deleted from the Pi system.");
            }
            return(data);
        }