You are here: Start » AVL.NET » AVL.NET Dialogs
AVL.NET Dialogs
Introduction
It is possible in AVL.NET to use visual data editors known from Adaptive Vision Studio for objects such as paths, segments, regions, etc. These editors are implemented in Avl.Net.Designers.dll library, AvlNet.Designers namespace (complete editor list can be found here).
AVL.NET editor usage is almost the same as of .NET dialogs. Each editor exposes at least: a public property of the type it is designed to edit and a public ShowDialog() method which returns a DialogResult enumeration.
Example
The following example is a part of the simple image thresholding application that allows to threshold an image within the user-defined ROI which can be defined with RegionDesigner. The complete source code can be found here.
The application, besides the region editor provided by the Avl.Net.Designers.dll assembly, is a single-form application that contains two picture boxes, two track bar controls responsible for setting the thresholds and several buttons that allow to load images:
//...
Region roi;
/// <summary>
/// image being thresholded
/// </summary>
Image image;
//...
/// <summary>
/// Performs image thresholding either in defined ROI or of a cropped image.
/// </summary>
private void UpdateThresholdResult()
{
//...
AVL.ThresholdImage(image, roi, minTrackBar.Value, maxTrackBar.Value, 1.0f, out thresholdedImage);
//...
resultPreview.Image = thresholdedImage.CreateBitmap();
//...
}
/// <summary>
/// Opens a RegionDesigner to edit a ROI within which an image will be thresholded.
/// </summary>
private void regionButton_Click(object sender, EventArgs e)
{
using (RegionDesigner designer = new RegionDesigner())
{
if (image != null)
designer.Backgrounds = new Image[] { image };
designer.Region = roi;
if (designer.ShowDialog(this) == DialogResult.OK)
{
roi = designer.Region;
}
}
UpdatePreview();
UpdateThresholdResult();
}
Clicking on the Edit ROI button opens the following region editor:
Available editors
- Arc2DArrayDesigner
- Arc2DDesigner
- ArcFittingFieldArrayDesigner
- ArcFittingFieldDesigner
- BoxArrayDesigner
- BoxDesigner
- Circle2DArrayDesigner
- Circle2DDesigner
- CircleFittingFieldArrayDesigner
- CircleFittingFieldDesigner
- EdgeModelDesigner
- GrayModelDesigner
- Line2DArrayDesigner
- Line2DDesigner
- LocationArrayDesigner
- LocationDesigner
- PathArrayDesigner
- PathDesigner
- PathFittingFieldArrayDesigner
- PathFittingFieldDesigner
- Point2DArrayDesigner
- Point2DDesigner
- Rectangle2DArrayDesigner
- Rectangle2DDesigner
- RegionDesigner
- Segment2DArrayDesigner
- Segment2DDesigner
- SegmentFittingFieldArrayDesigner
- SegmentFittingFieldDesigner
- SegmentScanFieldArrayDesigner
- SegmentScanFieldDesigner
- ShapeRegionArrayDesigner
- ShapeRegionDesigner
| Previous: Relation between AVL.NET and AVL/C++ | Next: Usage Examples |
