Esempio n. 1
0
        private void _annAutomationObjects_ItemRemoved(object sender, AnnObjectCollectionEventArgs e)
        {
            // Check if we are updating the zones, no need for this
            if (_ignoreAddRemove)
            {
                return;
            }
            // User deleted the annotation object, delete the corresponding zone
            ZoneAnnotationObject zoneObject = e.Object as ZoneAnnotationObject;

            if (zoneObject != null)
            {
                if (_setSelect)
                {
                    InteractiveMode = ViewerControlInteractiveMode.SelectMode;
                    return;
                }
                _setSelect = true;
                int index = zoneObject.ZoneIndex;
                _ocrPage.Zones.RemoveAt(index);

                // Reset all the zones
                for (int i = 0; i < _annAutomation.Container.Children.Count; i++)
                {
                    zoneObject = _annAutomation.Container.Children[i] as ZoneAnnotationObject;
                    zoneObject.SetZone(_ocrPage, i, _showZonesToolStripButton.Checked, _showZoneNameToolStripButton.Checked);
                }

                // We should mark the page as unrecognized since we updated its zones
                _ocrPage.Unrecognize();
                // Update the thumbnail(s)
                DoAction("RefreshPagesControl", false);
            }
        }
Esempio n. 2
0
 void Container_ObjectAdded(object sender, AnnObjectCollectionEventArgs e)
 {
     if (e.Object == null)
     {
         return;
     }
     // Check if we are updating the zones, no need for this
     if (_ignoreAddRemove)
     {
         return;
     }
 }
Esempio n. 3
0
        private void _annAutomationObjects_ItemAdded(object sender, AnnObjectCollectionEventArgs e)
        {
            if (e.Object == null)
            {
                return;
            }
            // Check if we are updating the zones, no need for this
            if (_ignoreAddRemove)
            {
                return;
            }


            //// Add a new zone from the annotation rectangle object
            //ZoneAnnotationObject zoneObject = e.Object as ZoneAnnotationObject;

            //OcrZone zone = new OcrZone();
            //zone.Bounds = RestrictZoneBoundsToPage(_ocrPage, BoundsFromAnnotations(zoneObject, _annAutomation.Container));
            //_ocrPage.Zones.Add(zone);

            //// Set the zone
            //zoneObject.SetZone(_ocrPage, _ocrPage.Zones.Count - 1, _showZonesToolStripButton.Checked, _showZoneNameToolStripButton.Checked);

            //// Convert the pen width to logical units in case we are zoomed in
            //if (e.Object.SupportsStroke && e.Object.Stroke != null)
            //{
            //   //leadlengthd penwidth = e.object.stroke.strokethickness;
            //   //leadpointd[] pts = { new leadpointd(penwidth.value, penwidth.value) };
            //   //pts = _annautomation.container.mapper.pointsfromcontainercoordinates(pts, annfixedstateoperations.none);
            //   //penwidth = new leadlengthd(pts[0].x);
            //   //e.object.stroke.strokethickness = penwidth;
            //}

            //InteractiveMode = ViewerControlInteractiveMode.DrawZoneMode;
            //UpdateUIState();
        }