Barcode .Net Class Library

Draw Method (1)

Applies To: Barcode | BarcodeControl | BarcodeImage

Draws a barcode to a System.Drawing.Graphics object. This is the simplest of the three versions of the Draw method.

[Visual Basic]
Public Sub Draw( _
   ByVal g As Graphics, _
   ByVal rect As RectangleF, _
   ByVal extraFlags As BarcodeDrawFlags, _
   ByVal textOnlyString As String _
)

[C#]
public void Draw(
   Graphics g, 
   RectangleF rect, 
   BarcodeDrawFlags extraFlags, 
   string textOnlyString
);

Parameters

g
Graphics object to which the barcode is to be drawn.
rect
Location and size of the barcode. rect.width may be either that of the narrowest bar of the barcode or that the entire barcode, depending on whether the BarcodeDrawflags.WidthPerModule bit is set in the extraFlags parameter.
extraFlags
A BarcodeDrawFlags enumeration specifying how the barcode is to be drawn, complementing the current property settings. Only the subset of the BarcodeDrawFlags members (cf. table below) that have no corresponding properties can be used and will be effective.
Member Name Description
NoDrawBackground Do not draw the background.
CalculateSizeOnly Do not actually draw the barcode; calculate the barcode position and size only.
Clip Clip the barcode to the target rectangle.
PaintWholeRect Paint the background of the entire target rectangle even if the actual barcode will only take up part of it.
DrawTextOnly Draw only the barcode data, not the barcode.
DrawBackgroundOnly Draw only the background, not the barcode.
WidthPerModule Indicates that the width parameter specifies the width of the thinnest barcode bar rather than that of the barcode.
NoRestoreGraphicsState Do not restore the state of the Graphics object after drawing.
textOnlyString
If not null, only this string will be drawn instead of a barcode image.

See Also

Draw (2) | Draw (3)


© 2002 Bokai Corporation. All rights reserved.