Esempio n. 1
0
        ///// <summary>
        ///// Gets processed image from processing chain.
        ///// </summary>
        ///// <param name="image">Bitmap image to be returned.</param>
        ///// <param name="timeout">Time interval required to wait for the image (in milliseconds)</param>
        //public void ProcPullImage(out Bitmap image, int timeout)
        //{
        //  XI_IMG img = default(XI_IMG);
        //  img.Clear();
        //  ProcPullImageInternal(out img, timeout);
        //  xiImg xiImg = new xiImg(img);
        //  xiImg.GetBitmapByRef(out image);
        //}

        ///// <summary>
        ///// Gets processed image from processing chain.
        ///// </summary>
        ///// <param name="image">BitmapSource image to be returned.</param>
        ///// <param name="timeout">Time interval required to wait for the image (in milliseconds)</param>
        //public void ProcPullImage(out BitmapSource image, int timeout)
        //{
        //  XI_IMG img = default(XI_IMG);
        //  img.Clear();
        //  ProcPullImageInternal(out img, timeout);
        //  xiImg xiImg = new xiImg(img);
        //  xiImg.GetBitmapSourceByRef(out image);
        //}

        ///// <summary>
        ///// Gets processed image from processing chain.
        ///// </summary>
        ///// <param name="val">WriteableBitmap image to be returned.</param>
        ///// <param name="timeout">Time interval required to wait for the image (in milliseconds)</param>
        //public void ProcPullImage(out WriteableBitmap image, int timeout)
        //{
        //  XI_IMG img = default(XI_IMG);
        //  img.Clear();
        //  ProcPullImageInternal(out img, timeout);
        //  xiImg xiImg = new xiImg(img);
        //  xiImg.GetWriteableBitmapByRef(out image);
        //}

        /// <summary>
        /// Gets processed image from processing chain.
        /// </summary>
        /// <param name="img_arr">Byte array image data to be returned.</param>
        /// <param name="timeout">Time interval required to wait for the image (in milliseconds)</param>
        public void ProcPullImage(out byte[] img_arr, int timeout)
        {
            XI_IMG img = default(XI_IMG);

            img.Clear();
            ProcPullImageInternal(out img, timeout);
            xiImg xiImg = new xiImg(img);

            xiImg.GetByteArrayByRef(out img_arr);
        }
Esempio n. 2
0
        /// <summary>
        /// This function acquires image into a byte array. Supports UNSAFE buffer policy mode.
        /// </summary>
        /// <param name="img_arr">Preallocated byte array to be filled</param>
        /// <param name="timeout">Time interval required to wait for the image (in milliseconds)</param>
        public void GetImage(out byte[] img_arr, int timeout)
        {
            XI_IMG input_img = default(XI_IMG);

            input_img.Clear();
            input_img = GetImageInternal(input_img, timeout);
            xiImg xiImg = new xiImg(input_img);

            xiImg.GetByteArrayByRef(out img_arr);
        }