Printer.Line 方法 (Single, Single, Single, Single, Int32, Boolean, Boolean)

在打印的页行、正方形或矩形。

命名空间:  Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
程序集:  Microsoft.VisualBasic.PowerPacks.Vs(在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

语法

声明
Public Sub Line ( _
    x1 As Single, _
    y1 As Single, _
    x2 As Single, _
    y2 As Single, _
    color As Integer, _
    box As Boolean, _
    fill As Boolean _
)
public void Line(
    float x1,
    float y1,
    float x2,
    float y2,
    int color,
    bool box,
    bool fill
)
public:
void Line(
    float x1, 
    float y1, 
    float x2, 
    float y2, 
    int color, 
    bool box, 
    bool fill
)
member Line : 
        x1:float32 * 
        y1:float32 * 
        x2:float32 * 
        y2:float32 * 
        color:int * 
        box:bool * 
        fill:bool -> unit 
public function Line(
    x1 : float, 
    y1 : float, 
    x2 : float, 
    y2 : float, 
    color : int, 
    box : boolean, 
    fill : boolean
)

参数

  • x1
    类型:System.Single
    指示的水平坐标的Single 值用于打印的行的起点。
  • y1
    类型:System.Single
    指示垂直坐标的Single 值用于打印的行的起点。
  • x2
    类型:System.Single
    指示终结点的水平坐标的打印行的Single 值。
  • y2
    类型:System.Single
    指示终结点的垂直坐标的打印行的Single 值。
  • color
    类型:System.Int32
    可选。指示行的 RGB (红色、蓝色) 颜色Integer 值。如果此参数省略,使用 Black 的值。
  • box
    类型:System.Boolean
    可选。Boolean.如果此参数设置为 true,矩形打印。x1、 y1、 x2和 y2 坐标指定该矩形的对角。
  • fill
    类型:System.Boolean
    可选。Boolean.如果使用 box 参数,并 fill 参数设置为 true,该矩形在填充时使用的相同颜色的打印矩形。不能使用 fill 不 box。如果 box 使用,而不需要 fill,当前 FillColorFillStyle 值用于填充矩形。FillStyle 的默认是透明的。

备注

打印连接的行,以前的线条的终点启动一个后续行。

打印的行的宽度取决于设置 DrawWidth 属性。 行打印的方式取决于设置 DrawStyle 属性。

当 Line 运行时, CurrentXCurrentY 属性设置为参数指定的终结点。

备注

Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 命名空间中的函数和对象是提供给用于将 Visual Basic 6.0 升级到 Visual Basic 的工具使用的。大多数情况下,这些函数和对象可再现 .NET Framework 中其他命名空间的功能。只有 Visual Basic 6.0 代码模型与 .NET Framework 实现有显著区别时才需要这些函数和对象。

示例

下面的示例演示如何绘制矩形。

Dim pr As New Printer
pr.CurrentX = 500
pr.CurrentY = 500
pr.Line(pr.CurrentX, pr.CurrentY, 2000, 2000, vbRed, True, False)
pr.EndDoc()

.NET Framework 安全性

请参见

参考

Printer 类

Line 重载

Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 命名空间

其他资源

打印机兼容性库

如何:使用打印机兼容性库修复升级错误 (Visual Basic)

部署引用打印机兼容性库的应用程序