This file contains hidden or 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; | |
namespace CalcR2 | |
{ |
This file contains hidden or 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; | |
// Get average value and calculate new control parameters: | |
Jai_FactoryWrapper.PixelValue Average = new Jai_FactoryWrapper.PixelValue(); | |
// Allocate conversion buffer once | |
if (m_ConversionBuffer.ImageBuffer == IntPtr.Zero) | |
error = Jai_FactoryWrapper.J_Image_Malloc(ref ImageInfo, ref m_ConversionBuffer); |
This file contains hidden or 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 timer1_Tick(object sender, EventArgs e) | |
{ | |
labelR.Text = red.ToString(); | |
labelG.Text = green.ToString(); | |
labelB.Text = blue.ToString(); | |
} |
This file contains hidden or 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 hidden or 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 comboBox1_SelectedIndexChanged(object sender, EventArgs e) | |
{ | |
if (myPixelFormatNode != null) | |
{ | |
myPixelFormatNode.Value = comboBox1.SelectedItem; | |
if (m_ConversionBuffer.ImageBuffer != IntPtr.Zero) m_ConversionBuffer.ImageBuffer = IntPtr.Zero; | |
} | |
} |
This file contains hidden or 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"); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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); |