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


支援呈現為指定的點陣圖。Supports rendering to the specified bitmap.

 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

要繪製成的點陣圖。The bitmap to be drawn to.

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:

  • ArgumentException可能會針對大型點陣圖擲回。An 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.