Draws a barcode to a Graphics object. This is more flexible than Draw (1) but less flexible than Draw(3). Applies to Barcode, BarcodeControl or BarcodeImage.
[Visual Basic] Public Sub Draw( _ ByVal g As Graphics, _ ByVal rect As RectangleF, _ ByVal unit As GraphicsUnit, _ ByVal scale As float, _ ByVal extraFlags As BarcodeDrawFlags, _ ByVal textOnlyString As String _ ) [C#] public void Draw( Graphics g, RectangleF rect, GraphicsUnit unit, float scale, BarcodeDrawFlags extraFlags, string textOnlyString );
Value | Meaning |
Display | Specifies 1/75 inch as the unit of measure. |
Document | Specifies the document unit (1/300 inch) as the unit of measure. |
Inch | Specifies the inch as the unit of measure. |
Millimeter | Specifies the millimeter as the unit of measure. |
Pixel | Specifies a device pixel as the unit of measure. |
Point | Specifies a printer's point (1/72 inch) as the unit of measure. |
World | Specifies the world unit as the unit of measure. |
If World is specified, then the current PageUnit of g will be used and scale ignored.
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. |
Both unit and scale together specify the real unit for the rect parameter. This is true for general .Net graphics and GDI+ programming as well. For example, GraphicsUnit.Inch for unit and 0.01 for scale would specify the unit of measure of 0.01 inch (or LOENGLISH). Note that the real unit has to be small enough; you would not get the expected result by using scale=1 and compensatingly scaled-down numbers for rect.