Beispiel #1
0
        void DeviceFrameReady(object sender, IFrame frame)
        {
            System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
            watch.Reset();
            watch.Start();
            IDevice activeDevice = deviceManager.ActiveDevice;

            activeDevice.CTD = true;
            BitmapSource source = frame.ToBitmapSource();

            videoImage.Source = source;
            if (captureFrame)
            {
                bitmapFrame = BitmapFrame.Create(source);
                OnBitmapFrameCaptured(bitmapFrame);
                captureFrame = false;
            }
            if (screenshot)
            {
                Bitmap bmp = frame.ToBitmap();
                Deployment.Bmpsave(bmp);
                screenshot = false;
                headsUpDisplay.ScreenshotAck = false;
            }
            if (RecordVideoStream)
            {
                Deployment.RecordFrame(sender as IDevice, frame);
            }

            frame.Dispose();
            watch.Stop();
            headsUpDisplay.Fps = ((1000 / watch.ElapsedMilliseconds) + headsUpDisplay.Fps) / 2;
        }
		void DeviceFrameReady(object sender, IFrame frame)
		{
			System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
			watch.Reset();
			watch.Start();

			BitmapSource source = frame.ToBitmapSource();
			videoImage.Source = source;
			if (captureFrame)
			{
				bitmapFrame = BitmapFrame.Create(source);
				OnBitmapFrameCaptured(bitmapFrame);
				captureFrame = false;
			}
            if (screenshot)
            {
                Bitmap bmp = frame.ToBitmap();
                Deployment.Bmpsave(bmp);
                screenshot = false;
                headsUpDisplay.ScreenshotAck = false;
            }
			if(RecordVideoStream)
				Deployment.RecordFrame(sender as IDevice, frame);
			           
			frame.Dispose();
			watch.Stop();
			headsUpDisplay.Fps = ((1000 / watch.ElapsedMilliseconds) + headsUpDisplay.Fps) / 2;
		}