Created
August 2, 2017 00:29
-
-
Save immengineer/97785c058cc99fb725003434ee5e5e70 to your computer and use it in GitHub Desktop.
JAISDK ChildWindow 画像取込
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); | |
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