Even though not required for measurement purposes, it is possible to read the camera image out of a scan head (e.g., as a setup help). Example 9 does just that and fills a System.Windows.Forms.PictureBox every second with the bitmap obtained from the sensor head. As a shortcut, the laser will actually fire during the exposure as well, so you can verify and troubleshoot the position of the laser line easily. 

 

Due to the density of the filter element in front of the camera lens, the exposure time for a camera image can be quite long (multiple seconds). The GetImage() call will block during that time and the contents may be blurry, if the object in view is moving.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Windows.Forms;
using JoeScan.JCamNet;

namespace Examples
{
    public partial class Form1 : Form
    {
        private Scanner scanner = null;

        public Form1()
        {
            InitializeComponent();
            scanner = Scanner.Connect(new IPAddress(new byte[] { 192, 168, 1, 150 }));
            Timer liveUpdateTimer = new Timer { Interval = 1000 };
            liveUpdateTimer.Tick += (o, args) => { pictureBox.Image = scanner.GetImage().GetBitmap(); };
            liveUpdateTimer.Start();
        }
    }
}

 

example9.png
  • No labels