Printer.PSet 方法 (Boolean, Single, Single, Int32)
在頁面上,以指定的色彩列印單點,選擇性地指定相對於目前座標的點。
命名空間: Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
組件: Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)
語法
'宣告
Public Sub PSet ( _
relativeStart As Boolean, _
x As Single, _
y As Single, _
color As Integer _
)
public void PSet(
bool relativeStart,
float x,
float y,
int color
)
public:
void PSet(
bool relativeStart,
float x,
float y,
int color
)
member PSet :
relativeStart:bool *
x:float32 *
y:float32 *
color:int -> unit
public function PSet(
relativeStart : boolean,
x : float,
y : float,
color : int
)
參數
x
類型:SingleSingle 值,代表要列印的點的水平座標。
y
類型:SingleSingle 值,代表要列印的點的垂直座標。
color
類型:Int32選擇項。 Integer 值,表示為點所指定的 RGB (紅-綠-藍) 色彩。 如果省略這個參數,則會使用目前的 ForeColor 屬性設定。
備註
要列印的點的大小是由 DrawWidth 屬性的設定。 當 DrawWidth 設為 1 時, PSet 列印一點所指定的色彩。 當 DrawWidth 大於 1 時,會在指定座標的中央。
按列印的方式取決於 DrawStyle 屬性的設定。
當 PSet 執行時, CurrentX 和 CurrentY 屬性設定為這些引數指定的點。
注意事項 |
---|
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 命名空間中的函式和物件都是供這些工具使用,以便從 Visual Basic 6.0 升級至 Visual Basic。在大多數情況下,這些函式和物件會複製在 .NET Framework 的其他命名空間中可以找到的功能。只有當 Visual Basic 6.0 程式碼模型與 .NET Framework 實作有顯著差異時,才需要這些項目。 |
範例
下列範例示範如何列印一點,相對於 CurrentX 和 CurrentY設定的圖形位置,以指定的色彩。
Dim Printer As New Printer
Printer.CurrentX = 1000
Printer.CurrentY = 1000
Printer.PSet(True, 500, 500, vbRed)
Printer.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