This topic contains the following sections.
The Distance Segment Ellipse edit control provides a graphical user interface to the DistanceSegmentEllipse method, which returns the shortest distance from the given Segment to Ellipse. The edit control allows you to configure the segment and ellipse, dictate which graphics appear as the tool executes, and view tool results. The following figure shows the Distance Segment Ellipse edit control:

The edit control offers the following features:
- A row of control buttons at the top left
- A set of function tabs to define the segment and the ellipse, choose what graphics the tool will use, and view results
- An image display window for displaying tool images and graphics
You can experiment with the edit control by using QuickBuild to create a CogDistanceSegmentEllipse tool. A new CogDistanceSegmentEllipse tool appears as shown in the following figure:

The Segment and Ellipse parameters can either be specified directly from within the edit control or accepted as the result of other shape-generating vision tools. For example, the following figure shows how a Distance Segment Ellipse tool accepts the segment and ellipse generated as output from other tools:

To include the edit control in your custom vision application, you must first add it to your Visual Studio.NET development environment. See Using Edit Controls in Your Custom Vision Applications for more information.

The following table describes the function of each button:
| Button | Description | Function |
![]() | Run | Measures the distance between the line segment and the circle |
![]() | Electric mode | Toggles electric mode, where the Distance Segment Ellipse tool executes automatically when particular configuration parameters change. In electric mode, a lightning bolt appears next to every electric property |
![]() | Local image display | Opens or closes the local image display window. A Distance Segment Ellipse tool supports the following image buffers:
|
![]() | Floating image display | Opens one or more floating image windows, which support the same image buffers as the local image display window |
![]() | Open | Opens a VisionPro persistence (.vpp) file that contains a set of saved properties for this vision tool object type. VisionPro reports an error if you try to open a .vpp file for another object type. |
![]() | Save | Saves the current properties of the vision tool to a VisionPro persistence (.vpp) file. The edit control allows you to choose between saving the vision tool with or without its image buffers and tool results. |
![]() | Save As | Saves the current properties of the vision tool to a new VisionPro persistence (.vpp) file |
![]() | Reset | Resets the vision tool to its default state. |
![]() | Show ToolTips | Enables or disables the display of tooltips for individual items in the edit control |
![]() | Help | Opens this VisionPro online help file |
Use the Settings tab to define the input line segment and input circle, or use the tab to confirm that the existing shapes correspond to the correct input parameters generated by other tools. The following figure shows the Settings tab:

The Settings tab offers the following features to define the Segment parameter:
| Feature | Description |
| SelectedSpaceName | Names the coordinate space for the segment shape |
| Select Mode | Determines whether the line segment is determined by the 2 Points option (two [x, y] coordinates) or by the Point/Length option (a starting [x, y] coordinate followed by a line length and a measure of rotation). |
| StartX and StartY | Names the starting (x, y) coordinate of the line segment |
| EndX and EndY | Names the ending (x, y) coordinate of the line segment when using the 2 Points option. |
| Length and Rotation | Controls the length and angle of rotation of the line segment when using the Point/Length option. |
| FitToImage | Centers the line segment within the Current.InputImage |
The Settings tab offers the following features to define the Ellipse parameter:
| Feature | Description |
| SelectedSpaceName | Names the coordinate space for the ellipse shape |
| CenterX | The x-coordinate at the center of the ellipse |
| CenterY | The y-coordinate at the center of the ellipse |
| RadiusX | The distance from the center of the ellipse to its boundary along the x-axis. |
| RadiusY | The distance from the center of the ellipse to its boundary along the y-axis. |
| FitToImage | Centers the ellipse within the Current.InputImage |
Use the Graphics tab to control which graphics the Distance Segment Ellipse tool generates and displays. The following figure shows the Graphics tab:

The Graphics tab offers the following features:
| Feature | Description |
| Show Input Image | Determines whether or not the input image is recorded as part of the diagnostic record, and whether the image is copied to the record or saved in the record as a reference |
| Show Segment | Show Segment in the LastRun.InputImage buffer |
| Show Ellipse | Show Ellipse in the LastRun.InputImage buffer |
| Show Arrow | Show the line segment representing the shortest distance between Segment and Ellipse |
Use the Results tab to view the relationship between the point Segment and Ellipse as determined by the Distance Segment Ellipse tool. The following figure shows the Results tab:

The Results tab offers the following features:
| Feature | Description |
| Distance | The shortest distance between the point Segment and Ellipse |
| SegmentX and SegmentY | The (x, y) coordinate on Segment that is closest to Ellipse |
| EllipseX and EllipseY | The (x, y) coordinate on Ellipse that is closest to Segment |









