Ejemplo n.º 1
0
        /// <summary>
        /// Draws the specified text using the default barcode metrics for
        /// the specified maximum barcode height.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="maxBarHeight">The maximum bar height.</param>
        /// <param name="scale">
        /// The scale factor to use when rendering the barcode.
        /// </param>
        /// <returns>
        /// An <see cref="Image"/> object containing the rendered barcode.
        /// </returns>
        public Image Draw(string text, int maxBarHeight, int scale)
        {
            BarcodeMetrics defaultMetrics = GetDefaultMetrics(maxBarHeight);

            defaultMetrics.Scale = scale;
            return(Draw(text, defaultMetrics));
        }
Ejemplo n.º 2
0
        public DrawingImage DrawImage(string text, BarcodeMetrics metrics)
        {
            var drawing = Draw(text, metrics);

            RenderOptions.SetEdgeMode(drawing, EdgeMode.Aliased);
            var image = new DrawingImage(drawing);

            if (image.CanFreeze)
            {
                image.Freeze();
            }
            return(image);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Draws the specified text using the supplied barcode metrics.
 /// </summary>
 /// <param name="text">The text.</param>
 /// <param name="metrics">A <see cref="T:Zen.Barcode.BarcodeMetrics"/> object.</param>
 /// <returns></returns>
 public Image Draw(string text, BarcodeMetrics metrics)
 {
     if (metrics.InterGlyphSpacing < 0)
     {
         return(Draw(text,
                     metrics.MinHeight, metrics.MaxHeight,
                     metrics.MinWidth, metrics.MaxWidth));
     }
     else
     {
         return(Draw(text, metrics.InterGlyphSpacing,
                     metrics.MinHeight, metrics.MaxHeight,
                     metrics.MinWidth, metrics.MaxWidth));
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Draws the specified text using the supplied barcode metrics.
 /// </summary>
 /// <param name="dc"></param>
 /// <param name="text">The text.</param>
 /// <param name="metrics">A <see cref="T:Zen.Barcode.BarcodeMetrics"/> object.</param>
 /// <param name="bounds"></param>
 /// <returns></returns>
 public override sealed void Draw(DrawingContext dc, string text, BarcodeMetrics metrics, Rect bounds)
 {
     Draw1d(dc, text, (BarcodeMetrics1d)metrics, bounds);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Draws the specified text using the supplied barcode metrics.
 /// </summary>
 /// <param name="dc"></param>
 /// <param name="text">The text.</param>
 /// <param name="metrics">A <see cref="T:Zen.Barcode.BarcodeMetrics"/> object.</param>
 /// <param name="bounds"></param>
 /// <returns>
 /// An <see cref="ImageSource"/> object containing the rendered barcode.
 /// </returns>
 public abstract void Draw(DrawingContext dc, string text, BarcodeMetrics metrics, Rect bounds);
Ejemplo n.º 6
0
 /// <summary>
 /// Draws the specified text using the supplied barcode metrics.
 /// </summary>
 /// <param name="text">The text.</param>
 /// <param name="metrics">A <see cref="T:Zen.Barcode.BarcodeMetrics"/> object.</param>
 /// <returns></returns>
 public override sealed Image Draw(string text, BarcodeMetrics metrics)
 {
     return(Draw1d(text, (BarcodeMetrics1d)metrics));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Draws the specified text using the supplied barcode metrics.
 /// </summary>
 /// <param name="text">The text.</param>
 /// <param name="metrics">A <see cref="T:Zen.Barcode.BarcodeMetrics"/> object.</param>
 /// <returns>
 /// An <see cref="Image"/> object containing the rendered barcode.
 /// </returns>
 public abstract Image Draw(string text, BarcodeMetrics metrics);
Ejemplo n.º 8
0
        /// <summary>
        /// Draws the specified text using the default barcode metrics for
        /// the specified maximum barcode height.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="maxBarHeight">The maximum bar height.</param>
        /// <returns>
        /// An <see cref="Image"/> object containing the rendered barcode.
        /// </returns>
        public DrawingGroup Draw(string text, int maxBarHeight)
        {
            BarcodeMetrics defaultMetrics = GetDefaultMetrics(maxBarHeight);

            return(Draw(text, defaultMetrics));
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Draws the specified text using the supplied barcode metrics.
 /// </summary>
 /// <param name="text">The text.</param>
 /// <param name="metrics">A <see cref="T:Zen.Barcode.BarcodeMetrics"/> object.</param>
 /// <returns>
 /// An <see cref="Image"/> object containing the rendered barcode.
 /// </returns>
 public abstract DrawingGroup Draw(string text, BarcodeMetrics metrics);