Control.DrawToBitmap(Bitmap, Rectangle) 方法

定義

支援呈現為指定的點陣圖。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
Public Sub DrawToBitmap (bitmap As Bitmap, targetBounds As Rectangle)

參數

bitmap
Bitmap

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

targetBounds
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 Tablet PC Edition 2005 作業系統的 Ink 控制項。DrawToBitmap does not support the Ink controls for the Windows XP Tablet PC Edition 2005 operating system.

  • 如果 TextBoxVisible 屬性設定為 [false],DrawToBitmap 不會繪製子 TextBoxDrawToBitmap 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.

  • RichTextBoxDrawToBitmap 無法完全正常運作;只繪製點陣圖的框線。DrawToBitmap is not fully functional for the RichTextBox; only the border of a bitmap is drawn.

適用於

另請參閱