Example #1
0
        private void xfer_XferNotify(object sender, SapXferNotifyEventArgs argsNotify)
        {
            try
            {
                var core = argsNotify.Context as DalsaCore;
                if (argsNotify.Trash)
                {
                }
                else
                {
                    //DateTime getStart = DateTime.Now;

                    IntPtr bufferAddress;
                    Buffers.GetAddress(out bufferAddress);
                    Debug.WriteLine(_name + "Dalsa ImgPtr:[" + _id + "]" + bufferAddress + DateTime.Now);

                    var imgInfo = new ImgBytesInfo();
                    imgInfo._imgSrcPtr = bufferAddress;
                    imgInfo._imgBytes  = new byte[ObjSize];
                    imgInfo._imgTicks  = DateTime.Now.Ticks / 10000;
                    Marshal.Copy(bufferAddress, imgInfo._imgBytes, 0, ObjSize);

                    OnDalsaImageArrivedHandle(imgInfo);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }