Ejemplo n.º 1
0
        /// <summary>
        /// Draws the selection on specified System.Drawing.Graphics.
        /// </summary>
        /// <param name="viewer">An image viewer.</param>
        /// <param name="g">A graphics where this tool must be drawn.</param>
        public override void Draw(ImageViewer viewer, System.Drawing.Graphics g)
        {
#if !REMOVE_BARCODE_SDK
            if (RecognitionResults != null)
            {
                using (Matrix oldTransformation = g.Transform)
                {
                    g.Transform = VintasoftDrawingConverter.Convert(ImageViewer.ViewerState.GetTransformToViewer());
                    for (int i = 0; i < _recognitionResults.Length; i++)
                    {
                        DrawBarcodeInfo(g, _recognitionResults[i]);
                    }
                    g.Transform = oldTransformation;
                }
            }
#endif
            base.Draw(viewer, g);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Draws the visual tool on specified <see cref="Graphics"/>.
 /// </summary>
 /// <param name="viewer">An image viewer.</param>
 /// <param name="g">A graphics where this tool must be drawn.</param>
 public override void Draw(ImageViewer viewer, Graphics g)
 {
     if (BarcodeImage == null)
     {
         RefreshBarcodeImage(false);
     }
     if (BarcodeImage != null)
     {
         using (Matrix oldTransformation = g.Transform)
         {
             g.Transform = VintasoftDrawingConverter.Convert(ImageViewer.ViewerState.GetTransformToViewer());
             BarcodeImage.Draw(g, GetDestBarcodeImageRectangle());
             g.Transform = oldTransformation;
         }
     }
     else
     {
         base.Draw(viewer, g);
     }
 }