共用方式為


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
)

參數

  • relativeStart
    類型:Boolean

    Boolean 值,表示座標是否相對於目前圖形位置 (如 CurrentX, CurrentY 所設定)。

  • x
    類型:Single

    Single 值,代表要列印的點的水平座標。

  • y
    類型:Single

    Single 值,代表要列印的點的垂直座標。

  • color
    類型:Int32

    選擇項。 Integer 值,表示為點所指定的 RGB (紅-綠-藍) 色彩。 如果省略這個參數,則會使用目前的 ForeColor 屬性設定。

備註

要列印的點的大小是由 DrawWidth 屬性的設定。 當 DrawWidth 設為 1 時, PSet 列印一點所指定的色彩。 當 DrawWidth 大於 1 時,會在指定座標的中央。

按列印的方式取決於 DrawStyle 屬性的設定。

當 PSet 執行時, CurrentXCurrentY 屬性設定為這些引數指定的點。

注意事項注意事項

Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 命名空間中的函式和物件都是供這些工具使用,以便從 Visual Basic 6.0 升級至 Visual Basic。在大多數情況下,這些函式和物件會複製在 .NET Framework 的其他命名空間中可以找到的功能。只有當 Visual Basic 6.0 程式碼模型與 .NET Framework 實作有顯著差異時,才需要這些項目。

範例

下列範例示範如何列印一點,相對於 CurrentXCurrentY設定的圖形位置,以指定的色彩。

Dim Printer As New Printer
Printer.CurrentX = 1000
Printer.CurrentY = 1000
Printer.PSet(True, 500, 500, vbRed)
Printer.EndDoc()

.NET Framework 安全性

請參閱

參考

Printer 類別

PSet 多載

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

其他資源

Printer Compatibility Library

How to: Fix Upgrade Errors by Using the Printer Compatibility Library (Visual Basic)

Deploying Applications That Reference the Printer Compatibility Library