Applies To: Barcode | BarcodeControl | BarcodeImage
Draws a barcode to a Graphics object. This is the most flexible of all three versions the Draw method.
[Visual Basic] Public Sub Draw( _ ByVal g As Graphics, _ ByVal rect As RectangleF, _ ByVal unit As GraphicsUnit, _ ByVal scale As float, _ ByVal orientation As BarcodeOrientation, _ ByVal font As Font, _ ByVal clrFore As Color, _ ByVal clrBack As Color, _ ByVal flags As BarcodeDrawFlags, _ ByVal textOnlyString As String _ ) [C#] public void Draw( Graphics g, RectangleF rect, GraphicsUnit unit, float scale, BarcodeOrientation orientation, Font font, Color clrFore, Color clrBack, BarcodeDrawFlags flags, 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.
Overriden Property Name | BarcodeDrawFlags Member |
---|---|
AddOnTextPosition | AddOnTextAtTop, AddOnTextAtBottom, HideAddOnText |
HorizontalAlignment | Left, Center, Right |
PixelAligned | NotPixelAligned |
RetainAspectRatio | RetainAspectRatio |
ShowCode39StartStop | ShowCode39StartStop |
StretchText | NoStretchText |
TextPosition | MainTextAtTop, MainTextAtBottom, HideMainText |
UniBarHeight | UniBarHeight |
UpcSmallFont | NoUpcSmallFont |
VerticalAlignment | Top, Middle, Bottom |
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.