다음을 통해 공유


Shape.DrawToBitmap 메서드

지정한 비트맵에서의 렌더링을 지원합니다.

네임스페이스:  Microsoft.VisualBasic.PowerPacks
어셈블리:  Microsoft.VisualBasic.PowerPacks.Vs(Microsoft.VisualBasic.PowerPacks.Vs.dll)

구문

‘선언
Public MustOverride Sub DrawToBitmap ( _
    bitmap As Bitmap, _
    targetBounds As Rectangle _
)
public abstract void DrawToBitmap(
    Bitmap bitmap,
    Rectangle targetBounds
)
public:
virtual void DrawToBitmap(
    Bitmap^ bitmap, 
    Rectangle targetBounds
) abstract
abstract DrawToBitmap : 
        bitmap:Bitmap * 
        targetBounds:Rectangle -> unit 
public abstract function DrawToBitmap(
    bitmap : Bitmap, 
    targetBounds : Rectangle
)

매개 변수

설명

경우는 X 또는 Y 좌표 또는 Width 또는 Height 매개 변수를 targetBounds 0 보다 작은 ArgumentException throw 됩니다.

예제

다음 예제에서는 DrawToBitmap 그리는 메서드는 LineShape 위에 PictureBox 컨트롤.

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;

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

Shape 클래스

Microsoft.VisualBasic.PowerPacks 네임스페이스

기타 리소스

방법: LineShape 컨트롤로 선 그리기(Visual Studio)

방법: OvalShape 및 RectangleShape 컨트롤을 사용하여 도형 그리기(Visual Studio)

Line 및 Shape 컨트롤 소개(Visual Studio)