📄 barcodedraw1.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML DIR="LTR"><HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<TITLE>Draw Method (1)</TITLE></HEAD>
<body topmargin="0">
<font size="-1"> Barcode .Net Class Library</font>
<H3>Draw Method (1)</H3>
<p><b>Applies To:</b> <A HREF="barcodeClass.htm">Barcode</A> |
<A HREF="barcodeControlClass.htm">BarcodeControl</A> |
<A HREF="barcodeImageClass.htm">BarcodeImage</A>
<P>Draws a barcode to a System.Drawing.Graphics object. This is the simplest of the three versions of the
<b>Draw</b> method.</P>
<PRE><font size="-1">[Visual Basic]</font>
<B>Public Sub Draw(</B> _
<b>ByVal</b> <i>g</i> <b>As</b> Graphics, _
<b>ByVal</b> <i>rect</i> <b>As</b> RectangleF, _
<b>ByVal</b> <i>extraFlags</i> <b>As</b> <a href="drawFlagsEnum.htm">BarcodeDrawFlags</a>, _
<b>ByVal</b> <i>textOnlyString</i> <b>As</b> String _
<B>)</B>
<font size="-1">[C#]</font>
<B>public</b> void <b>Draw(</B>
Graphics <i>g</i>,
RectangleF <i>rect</i>,
<a href="drawFlagsEnum.htm">BarcodeDrawFlags</a> <i>extraFlags</i>,
string <i>textOnlyString</i>
<B>);</B>
</PRE>
<H4>Parameters</H4>
<DL><DT><I>g</I></DT>
<DD>Graphics object to which the barcode is to be drawn.
</DD></DL>
<DL><DT><I>rect</I></DT>
<DD>Location and size of the barcode. <i>rect.width</i> may be either that of the narrowest bar of the
barcode or that the entire barcode, depending on whether the <b>BarcodeDrawflags.WidthPerModule</b> bit is set in
the <i>extraFlags</i> parameter.
</DD></DL>
<DL><DT><I>extraFlags</I></DT>
<DD>A <a href="drawFlagsEnum.htm">BarcodeDrawFlags</a> 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.
<table cellspacing="0" border="1">
<TR>
<TH bgcolor="#cccccc">Member Name</TH>
<TH bgcolor="#cccccc">Description</TH>
</TR>
<TR>
<TD><tt>NoDrawBackground</tt></TD>
<TD>Do not draw the background.</TD>
</TR>
<TR>
<TD><tt>CalculateSizeOnly</tt></TD>
<TD>Do not actually draw the barcode; calculate the barcode position and size only.</TD>
</TR>
<TR>
<TD><tt>Clip</tt></TD>
<TD>Clip the barcode to the target rectangle.</TD>
</TR>
<TR>
<TD><tt>PaintWholeRect</tt></TD>
<TD>Paint the background of the entire target rectangle even if the actual barcode
will only take up part of it.</TD>
</TR>
<TR>
<TD><tt>DrawTextOnly</tt></TD>
<TD>Draw only the barcode data, not the barcode.</TD>
</TR>
<TR>
<TD><tt>DrawBackgroundOnly</tt></TD>
<TD>Draw only the background, not the barcode.</TD>
</TR>
<TR>
<TD><tt>WidthPerModule</tt></TD>
<TD>Indicates that the width parameter specifies the width of the thinnest barcode bar
rather than that of the barcode.</TD>
</TR>
<TR>
<TD><tt>NoRestoreGraphicsState</tt></TD>
<TD>Do not restore the state of the Graphics object after drawing.</TD>
</TR>
</table>
</DD></DL>
<DL><DT><I>textOnlyString</I></DT>
<DD>If not null, only this string will be drawn instead of a barcode image.
</DD></DL>
<H4 class="dtH4">See Also</H4>
<P><A HREF="barcodeDraw2.htm">Draw (2)</A> | <A HREF="barcodeDraw3.htm">Draw (3)</A></P>
<HR>
<font size="-1">© 2002 Bokai Corporation. All rights reserved.</font>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -