This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Text; | |
using System.Windows.Forms; | |
using Jai_FactoryDotNET; | |
namespace SimpleImageDisplaySample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void StartButton_Click(object sender, EventArgs e) | |
{ | |
if (myCamera != null) | |
myCamera.StartImageAcquisition(true, 5); | |
} | |
private void StopButton_Click(object sender, EventArgs e) | |
{ | |
if (myCamera != null) | |
myCamera.StopImageAcquisition(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void StartButton_Click(object sender, EventArgs e) | |
{ | |
if (myCamera != null) | |
{ | |
// Set the "Stretch flag" | |
myCamera.StretchLiveVideo = stretchCheckBox.Checked; | |
// Start the image acquisition with the picturebox windows handle. If the handle is IntPtr.Zero then a new window will be created | |
myCamera.StartImageAcquisition(true, 5, pictureBox1.Handle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void Form1_Resize(object sender, EventArgs e) | |
{ | |
// Here we need to resize the Child Window image display | |
if (myCamera != null) | |
{ | |
Jai_FactoryWrapper.RECT newRectSize; | |
if (myCamera.StretchLiveVideo) | |
newRectSize = new Jai_FactoryWrapper.RECT(0, 0, pictureBox1.Width, pictureBox1.Height); | |
else | |
newRectSize = new Jai_FactoryWrapper.RECT(0, 0, Convert.ToInt32(myCamera.GetNode("Width").Max), Convert.ToInt32(myCamera.GetNode("Height").Max)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void StartButton_Click(object sender, EventArgs e) | |
{ | |
if (myCamera != null) | |
{ | |
// Set the "Stretch flag" | |
myCamera.StretchLiveVideo = stretchCheckBox.Checked; | |
// Set the NewImageDelegete, will be called for every image captured | |
myCamera.NewImageDelegate += new Jai_FactoryWrapper.ImageCallBack(HandleImage); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void StopButton_Click(object sender, EventArgs e) | |
{ | |
if (myCamera != null) | |
{ | |
myCamera.StopImageAcquisition(); | |
StartButton.Enabled = true; | |
StopButton.Enabled = false; | |
stretchCheckBox.Enabled = true; | |
myCamera.NewImageDelegate -= new Jai_FactoryWrapper.ImageCallBack(HandleImage); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SimpleImageDisplaySample | |
{ | |
public partial class Form1 : Form | |
{ | |
// Main factory object | |
CFactory myFactory = new CFactory(); | |
// Opened camera object | |
CCamera myCamera; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void HandleImage(ref Jai_FactoryWrapper.ImageInfo ImageInfo) | |
{ | |
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryError.Success; | |
// Set Measurement area (100 x 100 Pixel) | |
m_MeasureRect.Left = 100; | |
m_MeasureRect.Top = 100; | |
m_MeasureRect.Right = 200; | |
m_MeasureRect.Bottom = 200; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SimpleImageDisplaySample | |
{ | |
public partial class Form1 : Form | |
{ | |
// Main factory object | |
CFactory myFactory = new CFactory(); | |
// Opened camera object | |
CCamera myCamera; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void GetPixelFormat() | |
{ | |
if (null == myCamera) | |
{ | |
return; | |
} | |
if (comboBox1.Items.Count > 0) comboBox1.Items.Clear(); | |
myPixelFormatNode = myCamera.GetNode("PixelFormat"); |
OlderNewer