Uses the current
ScalingMethod
to find the largest zoom value that allows the entire image to be visible in the display.
Namespace: Cognex.VisionPro.DisplayAssembly: Cognex.VisionPro.Display.Controls (in Cognex.VisionPro.Display.Controls.dll) Version: 73.0.0.0 (73.0.0.0)
Syntax
Parameters
- graphicsToo (Optional)
- Type: System Boolean
If true, the image is scaled and panned so that all graphics are visible too. This parameter is ignored if there are no graphics or if the graphics all lie within the bounds of the image.
Exceptions
| Exception | Condition |
|---|---|
| AxHost InvalidActiveXStateException | Thrown when the display control is invalid. |
Remarks
Fit(Boolean) sets the scale and pan values so that the entire image is visible in the display. If there are graphics outside the area of the image and graphicsToo is true, the image is scaled and panned so that the image and graphics are visible.
Examples
private void AcquireButton_Click(object sender, System.EventArgs e) { int trignum; cogDisplay1.Image = mAcqFifo.Acquire(out trignum); cogDisplay1.Fit(true); numAcqs++; if (numAcqs > 4) { GC.Collect(); numAcqs = 0; } }
Private Sub AcquireButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AcquireButton.Click
Dim trignum As Integer
cogDisplay1.Image = mAcqFifo.Acquire(trignum)
cogDisplay1.Fit(True)
numAcqs += 1
If numAcqs > 4 Then
GC.Collect()
numAcqs = 0
End If
End SubSee Also