PdfSharp.Drawing.XGraphics.DrawBarCode C# (CSharp) Method

DrawBarCode() public method

Draws the specified bar code.
public DrawBarCode ( BarCodes barcode, PdfSharp.Drawing.XBrush brush, PdfSharp.Drawing.XFont font, PdfSharp.Drawing.XPoint position ) : void
barcode BarCodes
brush PdfSharp.Drawing.XBrush
font PdfSharp.Drawing.XFont
position PdfSharp.Drawing.XPoint
return void
    public void DrawBarCode(BarCodes.BarCode barcode, XBrush brush, XFont font, XPoint position)
    {
      barcode.Render(this, brush, font, position);
    }

Same methods

XGraphics::DrawBarCode ( BarCodes barcode, PdfSharp.Drawing.XBrush brush, PdfSharp.Drawing.XPoint position ) : void
XGraphics::DrawBarCode ( BarCodes barcode, PdfSharp.Drawing.XPoint position ) : void

Usage Example

    /// <summary>
    /// Demonstrates the use of barcodes.
    /// </summary>
    public override void RenderPage(XGraphics gfx)
    {
      base.RenderPage(gfx);

      Graphics grfx = gfx.Internals.Graphics;

      Code2of5Interleaved bc25 = new Code2of5Interleaved();
      bc25.Text = "123456";
      bc25.Size = new XSize(90, 30);
      //bc25.Direction = CodeDirection.RightToLeft;
      bc25.TextLocation = TextLocation.Above;
      gfx.DrawBarCode(bc25, XBrushes.DarkBlue, new XPoint(100, 100));

      bc25.Direction = CodeDirection.RightToLeft;
      gfx.DrawBarCode(bc25, XBrushes.DarkBlue, new XPoint(300, 100));

      bc25.Direction = CodeDirection.TopToBottom;
      gfx.DrawBarCode(bc25, XBrushes.DarkBlue, new XPoint(100, 300));

      bc25.Direction = CodeDirection.BottomToTop;
      gfx.DrawBarCode(bc25, XBrushes.Red, new XPoint(300, 300));

      Code3of9Standard bc39 = new Code3of9Standard("ISABEL123", new XSize(90, 40));
      
      bc39.TextLocation = TextLocation.AboveEmbedded;
      gfx.DrawBarCode(bc39, XBrushes.DarkBlue, new XPoint(100, 500));

      bc39.Direction = CodeDirection.RightToLeft;
      gfx.DrawBarCode(bc39, XBrushes.DarkBlue, new XPoint(300, 500));

      bc39.Text = "TITUS";
      bc39.Direction = CodeDirection.TopToBottom;
      gfx.DrawBarCode(bc39, XBrushes.DarkBlue, new XPoint(100, 700));

      bc39.Direction = CodeDirection.BottomToTop;
      gfx.DrawBarCode(bc39, XBrushes.Red, new XPoint(300, 700));

    }
All Usage Examples Of PdfSharp.Drawing.XGraphics::DrawBarCode