Printer.Line 方法 (Boolean, Single, Single, Boolean, Single, Single, Int32, Boolean, Boolean)
在頁面上列印線條、方形或矩形。
命名空間: Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
組件: Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)
語法
'宣告
Public Sub Line ( _
relativeStart As Boolean, _
x1 As Single, _
y1 As Single, _
relativeEnd As Boolean, _
x2 As Single, _
y2 As Single, _
color As Integer, _
box As Boolean, _
fill As Boolean _
)
public void Line(
bool relativeStart,
float x1,
float y1,
bool relativeEnd,
float x2,
float y2,
int color,
bool box,
bool fill
)
public:
void Line(
bool relativeStart,
float x1,
float y1,
bool relativeEnd,
float x2,
float y2,
int color,
bool box,
bool fill
)
member Line :
relativeStart:bool *
x1:float32 *
y1:float32 *
relativeEnd:bool *
x2:float32 *
y2:float32 *
color:int *
box:bool *
fill:bool -> unit
public function Line(
relativeStart : boolean,
x1 : float,
y1 : float,
relativeEnd : boolean,
x2 : float,
y2 : float,
color : int,
box : boolean,
fill : boolean
)
參數
x1
類型:SingleSingle 值,代表要列印的線條的起點的水平座標值。
y1
類型:SingleSingle 值,代表要列印的線條的起點的垂直座標值。
x2
類型:SingleSingle 值,代表要列印的線條的終點的水平座標值。
y2
類型:SingleSingle 值,代表要列印的線條的終點的垂直座標值。
color
類型:Int32選擇項。 Integer 值,表示線條的 RGB (紅-綠-藍) 色彩。 如果省略這個參數,則會使用 Black 的值。
box
類型:Boolean選擇項。 Boolean. 如果這個參數設定為 true,則會列印矩形。 x1、 y1、 x2 以及y2座標會指定矩形的對角。
fill
類型:Boolean選擇項。 Boolean. 如果使用 box 參數,而且 fill 參數設為 true,則會以用來列印矩形的色彩。您不能使用 fill 不是 box。 如果未搭配 fill 使用 box,則會使用目前的 FillColor 和 FillStyle 值來填滿矩形。 FillStyle 的預設值為透明。
備註
若要列印連接線,請在上一行的端點啟動下一行。
要列印的線條的寬度取決於 DrawWidth 屬性的設定。 行列印的方式取決於 DrawStyle 屬性的設定。
當 Line 執行時, CurrentX 和 CurrentY 屬性設定為參數指定的端點。
注意事項 |
---|
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(True, 500, 500, 2000, 2000, vbRed, True, True)
pr.EndDoc()
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 命名空間
其他資源
How to: Fix Upgrade Errors by Using the Printer Compatibility Library (Visual Basic)
Deploying Applications That Reference the Printer Compatibility Library