示例#1
0
 /// <summary>
 /// Handles the Load event of the HalconWindowControl control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 private void HalconWindowControl_Load(object sender, EventArgs e)
 {
     if (sender is HSmartWindowControl)
     {
         halconImage  = new HalconImage();
         halconEngine = new HalconEngine();
         (sender as HSmartWindowControl).HKeepAspectRatio = true;
         halconWindow = (sender as HSmartWindowControl).HalconWindow;
         (sender as HSmartWindowControl).MouseWheel += HalconMouseWheel;
     }
 }
示例#2
0
 /// <summary>
 /// Handles the Click event of the buttonGrabImage control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
 private void buttonGrabImage_Click(object sender, EventArgs e)
 {
     GrabImage();
     HalconImage.DispObj(hWindowControl1.HalconWindow);
 }