Shows how to access the data from the scanner's camera. |
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();
}
}
} |
