/// <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)); }
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); }
/// <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)); } }
/// <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); }
/// <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);
/// <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)); }
/// <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);
/// <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)); }
/// <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);