Método LineShape.DrawToBitmap

Suporta o desenho para o bitmap especificado.

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (em Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintaxe

'Declaração
Public Overrides Sub DrawToBitmap ( _
    bitmap As Bitmap, _
    targetBounds As Rectangle _
)
public override void DrawToBitmap(
    Bitmap bitmap,
    Rectangle targetBounds
)
public:
virtual void DrawToBitmap(
    Bitmap^ bitmap, 
    Rectangle targetBounds
) override
abstract DrawToBitmap : 
        bitmap:Bitmap * 
        targetBounds:Rectangle -> unit 
override DrawToBitmap : 
        bitmap:Bitmap * 
        targetBounds:Rectangle -> unit 
public override function DrawToBitmap(
    bitmap : Bitmap, 
    targetBounds : Rectangle
)

Parâmetros

Comentários

Se a X ou Y coordenadas ou o Width ou Height parâmetros de targetBounds são menores do que 0, um ArgumentException será lançada.

Exemplos

O exemplo a seguir demonstra como usar o DrawToBitmap método para desenhar um LineShape em um PictureBox controle.

Dim pic As New System.Drawing.Bitmap(Me.PictureBox1.Image,
 PictureBox1.Width, PictureBox1.Height)
Dim rect As New System.Drawing.Rectangle(LineShape1.X1,
 LineShape1.Y1, LineShape1.X2 - LineShape1.X1,
 LineShape1.Y2 - LineShape1.Y1)
LineShape1.DrawToBitmap(pic, rect)
PictureBox2.Image = pic
System.Drawing.Bitmap pic = new System.Drawing.Bitmap
    (this.pictureBox1.Image, pictureBox1.Width, pictureBox1.Height);
System.Drawing.Rectangle rect = new System.Drawing.Rectangle
    (lineShape1.X1, lineShape1.Y1, lineShape1.X2 - lineShape1.X1, 
    lineShape1.Y2 - lineShape1.Y1);
lineShape1.DrawToBitmap(pic, rect);
pictureBox2.Image = pic;

Segurança do .NET Framework

Consulte também

Referência

LineShape Classe

Namespace Microsoft.VisualBasic.PowerPacks

ShapeContainer

Shape

Outros recursos

Como: desenhar formas com os controles de RectangleShape (Visual Studio) e o OvalShape

Como: desenhar linhas com o controle de LineShape (Visual Studio)

Introdução à linha e controles Shape (Visual Studio)