Skip to content

Instantly share code, notes, and snippets.

@immengineer
Created August 2, 2017 00:29
Show Gist options
  • Save immengineer/97785c058cc99fb725003434ee5e5e70 to your computer and use it in GitHub Desktop.
Save immengineer/97785c058cc99fb725003434ee5e5e70 to your computer and use it in GitHub Desktop.
JAISDK ChildWindow 画像取込
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);
StartButton.Enabled = false;
StopButton.Enabled = true;
stretchCheckBox.Enabled = false;
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));
Jai_FactoryWrapper.J_Image_ResizeChildWindow(myCamera.WindowHandle, ref newRectSize);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment