共用方式為


Printer.PaintPicture 方法

在頁面上列印影像檔的內容。

命名空間:  Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
組件:  Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

語法

'宣告
Public Sub PaintPicture ( _
    picture As Image, _
    x1 As Single, _
    y1 As Single, _
    width1 As Single, _
    height1 As Single, _
    x2 As Single, _
    y2 As Single, _
    width2 As Single, _
    height2 As Single _
)
public void PaintPicture(
    Image picture,
    float x1,
    float y1,
    float width1,
    float height1,
    float x2,
    float y2,
    float width2,
    float height2
)
public:
void PaintPicture(
    Image^ picture, 
    float x1, 
    float y1, 
    float width1, 
    float height1, 
    float x2, 
    float y2, 
    float width2, 
    float height2
)
member PaintPicture : 
        picture:Image * 
        x1:float32 * 
        y1:float32 * 
        width1:float32 * 
        height1:float32 * 
        x2:float32 * 
        y2:float32 * 
        width2:float32 * 
        height2:float32 -> unit
public function PaintPicture(
    picture : Image, 
    x1 : float, 
    y1 : float, 
    width1 : float, 
    height1 : float, 
    x2 : float, 
    y2 : float, 
    width2 : float, 
    height2 : float
)

參數

  • picture
    類型:Image

    Image值,表示要列印的影像。

  • x1
    類型:Single

    Single值,代表要列印影像的水平的目的端座標。 ScaleMode 屬性會決定所使用的測量單位。

  • y1
    類型:Single

    Single值,代表要列印影像的垂直目的端座標。 ScaleMode 屬性會決定所使用的測量單位。

  • width1
    類型:Single

    選擇項。 Single值,代表圖片目的端的寬度。 物件的 ScaleMode 屬性會判斷所使用的量值單位。 如果目的端寬度大於或小於來源寬度,圖片會自動縮放或壓縮以符合。 如果省略,則會使用來源寬度。

  • height1
    類型:Single

    選擇項。 Single值,代表圖片目的端的高度。 物件的 ScaleMode 屬性會判斷所使用的量值單位。 如果目的端高度大於或小於來源高度,圖片會自動縮放或壓縮以符合。 如果省略,則會使用來源高度。

  • x2
    類型:Single

    選擇項。 Single值,代表圖片中剪取區域內的座標 (x 軸 )。 物件的 ScaleMode 屬性會判斷所使用的量值單位。 如果省略,則假設為 0。

  • y2
    類型:Single

    選擇項。 Single值,代表圖片中剪取區域內的座標 (y 軸)。 物件的 ScaleMode 屬性會判斷所使用的量值單位。 如果省略,則假設為 0。

  • width2
    類型:Single

    選擇項。 Single值,代表圖片中剪取區域內的來源寬度。 物件的 ScaleMode 屬性會判斷所使用的量值單位。 如果省略,則會使用整個來源寬度。

  • height2
    類型:Single

    選擇項。 Single值,代表圖片中剪取區域內的來源高度。 物件的 ScaleMode 屬性會判斷所使用的量值單位。 如果省略,則會使用整個來源高度。

備註

您可以水平或垂直翻轉圖片使用目的端高度 (height1) 和 (或) 目的端寬度 (width1) 負值。

例如,當您想要,可以省略許多選擇性的後端引數。 如果您省略選擇性的後端引數或引數,而不要使用任何逗號在您指定的最後一個引數後。 如果您要指定選擇性引數,您必須指定出現在語法在它之前的所有選擇性引數。

注意事項注意事項

Printer 物件的 Visual Basic 6.0 版包含額外的參數, OpCode,可用來對點陣圖影像的位元運算。這個參數不再支援。

注意事項注意事項

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

範例

下列範例會示範如何列印頁面的影像,延伸或壓縮成特定大小。 它假設,您已將 Image 資源加入至專案中名為 Image1。

Dim pr As New Printer
pr.PaintPicture(My.Resources.Image1, 500, 500, 1000, 1000)
pr.EndDoc()

.NET Framework 安全性

請參閱

參考

Printer 類別

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