Exemplo n.º 1
0
        //private int _bufferIndex;

        /* Handles image receiving from Pylon library. */
        private void OnImageReadyHandler()
        {
            worker.HandleBufferUpdate(ImageProvider);

            /*image = ImageProvider.GetLatestImage ();
             *
             * var ImageObject = _buffer [_bufferIndex];
             *
             * if (image != null) {
             *
             *
             *      if (BitmapFactory.IsCompatible (ImageObject, image.Width, image.Height, image.Color)) {
             *
             *
             *              BitmapFactory.UpdateBitmap (ImageObject, image.Buffer, image.Width, image.Height, image.Color);
             *
             *
             *      }
             *      else {
             *
             *              BitmapFactory.CreateBitmap (out Bitmap b, image.Width, image.Height, image.Color);
             *              BitmapFactory.UpdateBitmap (b, image.Buffer, image.Width, image.Height, image.Color);
             *
             *              _buffer [_bufferIndex] = b;
             *
             *              BitmapFactory.CreateBitmap (out Bitmap bitmap, image.Width, image.Height, image.Color);
             *              BitmapFactory.UpdateBitmap (bitmap, image.Buffer, image.Width, image.Height, image.Color);
             *
             *
             *
             *              pictureBox.InvokeSet (bitmap);
             *
             *
             *      }
             *
             *      _bufferIndex++;
             *
             *
             *
             *      if (_bufferIndex >= _buffer.Length)
             *              _bufferIndex = 0;
             *
             *
             *
             *      ImageProvider.ReleaseImage ();
             *
             *      if (FpsLimit > 1 && !project.Started && !onPreviewSaving) {
             *
             *              fpsCounter++;
             *
             *              if (fpsCounter >= FpsLimit) {
             *
             *                      OnPreviewImageReadyHandler ();
             *
             *                      fpsCounter = 0;
             *
             *              }
             *      }
             *      else if (FpsLimit > 0 && !project.Started && !onPreviewSaving) {
             *
             *              OnPreviewImageReadyHandler ();
             *
             *      }
             * }*/
        }