Beispiel #1
0
        public void OnImageCaptured(Touchless.Vision.Contracts.IFrameSource frameSource, Touchless.Vision.Contracts.Frame frame, double fps)
        {

            //Image img = frame.Image.Clone(new RectangleF(0, 0, this.ImgControl.Width, this.ImgControl.Height), System.Drawing.Imaging.PixelFormat.Undefined);
            //_latestFrame = img as Bitmap;
            _latestFrame = frame.Image;
            ImgControl.Invalidate();
        }
        private void NewFrame(Touchless.Vision.Contracts.IFrameSource frameSource, Touchless.Vision.Contracts.Frame frame, double fps)
        {
            //We want to ignore frames we can't render fast enough
            lock (_frameSync)
            {
                if (!_frameWaiting)
                {
                    _frameWaiting = true;
                    Action workAction = delegate
                    {
                        this.labelCameraFPSValue.Content = fps.ToString();
                        this.imgPreview.Source = frame.OriginalImage.ToBitmapSource();

                        lock (_frameSync)
                        {
                            _frameWaiting = false;
                        }
                    };
                    Dispatcher.BeginInvoke(workAction);
                }
            }
        }
Beispiel #3
0
 public void OnImageCaptured(Touchless.Vision.Contracts.IFrameSource frameSource, Touchless.Vision.Contracts.Frame frame, double fps)
 {
     _latestFrame = frame.Image;
     pictureBoxDisplay.Invalidate();
 }
        void _frameSource_NewFrame(Touchless.Vision.Contracts.IFrameSource frameSource, Touchless.Vision.Contracts.Frame frame, double fps)
        {
            _latestFrame = frame.Image;
            Bitmap bmp = EnvironmentFunction.CopyBitmap(_latestFrame);
            ((PictureBox)controlHandle).Image = _latestFrame;
            frameCount++;
            //parentWindow.barStaticItemFrameCount.Caption = frameCount.ToString();

            ((PictureBox)controlHandle).Invalidate();
            if (obRecord != null)
            {
                if (dataArriveCount == 0)
                {
                    ((ObjectRecordAVI)obRecord).InitTempRecordAvi(bmp, this.videoCamera.Fps);
                    dataArriveCount++;
                }
                if (isRecording && dataArriveCount > 0)
                {
                    ((ObjectRecordAVI)obRecord).AddBitmapToTempFile(bmp);
                }
                bmp.Dispose();
            }
        }
Beispiel #5
0
 public void OnImageCaptured(Touchless.Vision.Contracts.IFrameSource frameSource, Touchless.Vision.Contracts.Frame frame, double fps)
 {
     _image = frame.Image;
     this.NotifyWaitingComponents();
 }