Click or drag to resize

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.0.0.0.0.297 (.NET 4.5.2, x86)
Syntax
public void Render(
	string text,
	Graphics graphics,
	Rectangle rect
)

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
ExceptionCondition
ArgumentExceptionThrown 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
//Consider a Form with a PictureBox pictureBox1 on it.

//Create the Barcode object (Style defaults to Code39).
Barcode bc = new Barcode();

//Get a Graphic object from the PictureBox (The image has to be created first!).
Graphics g = Graphics.FromImage(pictureBox1.Image);

//Render the bar code.
bc.Render("123456", g, pictureBox1.ClientRectangle); 

//Dispose resources.
g.Dispose();
bc.Dispose();
See Also