BarcodeWriterRender Method (String, Graphics, Rectangle) |
Renders the bar code in the supplied layout rectangle.
Namespace:
Atalasoft.Barcoding.Writing
Assembly:
Atalasoft.dotImage.Barcoding.Writing (in Atalasoft.dotImage.Barcoding.Writing.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax public void Render(
string text,
Graphics graphics,
Rectangle rect
)
Public Sub Render (
text As String,
graphics As Graphics,
rect As Rectangle
)
Parameters
- text
- Type: SystemString
Text to encode. - graphics
- Type: System.DrawingGraphics
Graphics object where the bar code will be rendered. - rect
- Type: System.DrawingRectangle
Layout rectangle for the bar code.
Exceptions Exception | Condition |
---|
ArgumentException | Thrown when one or more characters are not supported with the selected style. |
Remarks
Note that the Rectangle argument is passed by reference. When returning, the variable will hold the exact rectangle where the
bar code symbol was rendered. This is usefull if some other information has to be displayed in a position relative to the symbol.
Remarks Although any string may be passed in, not all characters may be representable in the barcode. Use
Validate(String, Boolean)() to ensure that all text is renderable.
Examples
Barcode bc = new Barcode();
Graphics g = Graphics.FromImage(pictureBox1.Image);
bc.Render("123456", g, pictureBox1.ClientRectangle);
g.Dispose();
bc.Dispose();
See Also