The Rubberband interactive mode of our ImageViewer control is implemented in several demos that ship with the toolkit, including the OcrModulesDemo project.
The event you need to handle is ImageViewerRubberBandInteractiveMode.RubberBandCompleted.
The code to initialize the mode is this:
_viewer.InteractiveModes.BeginUpdate();
_rubberBandMode = new ImageViewerRubberBandInteractiveMode();
_rubberBandMode.IdleCursor = Cursors.Cross;
_rubberBandMode.WorkingCursor = Cursors.Cross;
_rubberBandMode.RubberBandCompleted += new EventHandler(_rubberBandMode_RubberBandCompleted);
_viewer.InteractiveModes.Add(_rubberBandMode);
_viewer.InteractiveModes.EndUpdate();
The event handler looks like this:
private void _rubberBandMode_RubberBandCompleted(object sender, ImageViewerRubberBandEventArgs e)
{
_frameRect = _viewer.ConvertRect(null,
ImageViewerCoordinateType.Control,
ImageViewerCoordinateType.Image,
LeadRect.FromLTRB(e.Points[0].X, e.Points[0].Y, e.Points[1].X, e.Points[1].Y));
}
Please check how the demos implement this event to obtain the selected area. If you still face problems, contact our support through email or chat (both are free) and include full details about the problem, your LEADTOOLS version and what you tried so far.
The contact details are on
this page.