Control.DrawToBitmap(Bitmap, Rectangle) Control.DrawToBitmap(Bitmap, Rectangle) Control.DrawToBitmap(Bitmap, Rectangle) Method

定义

支持对指定位图的呈现。Supports rendering to the specified bitmap.

public:
 void DrawToBitmap(System::Drawing::Bitmap ^ bitmap, System::Drawing::Rectangle targetBounds);
public void DrawToBitmap (System.Drawing.Bitmap bitmap, System.Drawing.Rectangle targetBounds);
member this.DrawToBitmap : System.Drawing.Bitmap * System.Drawing.Rectangle -> unit

参数

bitmap
Bitmap Bitmap Bitmap

要绘制到的位图。The bitmap to be drawn to.

targetBounds
Rectangle Rectangle Rectangle

呈现控件时的边界。The bounds within which the control is rendered.

注解

ActiveX DrawToBitmap控件不支持此方法。The DrawToBitmap method is not supported for ActiveX controls. 可以重写OnPrint事件,并在需要时提供自定义打印逻辑。You can override the OnPrint event and provide custom printing logic if required.

DrawToBitmap方法具有以下限制:The DrawToBitmap method has the following limitations:

  • 对于大位图,可能会引发。ArgumentExceptionAn ArgumentException might be thrown for large bitmaps. 允许的最大大小因计算机而异。The maximum allowable size varies by machine.

  • DrawToBitmap不支持 Windows XP Ink Tablet PC Edition 2005 操作系统的控件。DrawToBitmap does not support the Ink controls for the Windows XP Tablet PC Edition 2005 operating system.

  • DrawToBitmap如果的TextBox 属性设置为TextBox ,则false不绘制子级。 VisibleDrawToBitmap does not draw a child TextBox if the Visible property of the TextBox is set to false.

  • 容器内的控件按相反的顺序呈现。Controls inside containers are rendered in reverse order.

  • DrawToBitmap对于没有完全功能RichTextBox; 只绘制位图的边框。DrawToBitmap is not fully functional for the RichTextBox; only the border of a bitmap is drawn.

适用于

另请参阅