void xfer_XferNotify(object sender, SapXferNotifyEventArgs args)
        {
            // refresh view
            SapBuffer buffer   = args.Context as SapBuffer;
            string    filename = _save_dir + string.Format("Frame-{2}--Aux time-{0}--Host time-{1}.bmp", (args.AuxTimeStamp / 1e6).ToString(), (args.HostTimeStamp / 1e7).ToString(), (args.GenericParamValue0 - 1).ToString());

            buffer.Save(filename, "-format bmp");
            //buffer.Save("test.bmp", "-format bmp");
            Console.WriteLine("Aux time: {0}, Host time: {1}, Frame: {2}", (args.AuxTimeStamp / 1e6).ToString(), (args.HostTimeStamp / 1e7).ToString(), args.GenericParamValue0.ToString());


            SapTransfer transfer = sender as SapTransfer;

            if (transfer.UpdateFrameRateStatistics())
            {
                SapXferFrameRateInfo stats = transfer.FrameRateStatistics;
                float framerate            = 0.0f;

                if (stats.IsLiveFrameRateAvailable)
                {
                    framerate = stats.LiveFrameRate;
                }

                // check if frame rate is stalled
                if (stats.IsLiveFrameRateStalled)
                {
                    Console.WriteLine("Live Frame rate is stalled.");
                }
            }
        }