Class ActiveXSnapshot
Provides support for capturing an ActiveX or Windows Forms control to a bitmap.
Inheritance
Inherited Members
Namespace: Syncfusion.Drawing
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class ActiveXSnapshot
Constructors
ActiveXSnapshot()
Declaration
public ActiveXSnapshot()
Properties
ForceWmPaintInPrintWindow
Indicates whether there are issues with WM_PRINT and it is not properly supported by the framework. The property is available to provide a workaround for issues with GenericControlCell and early Whidbey builds. Default is false.
Declaration
public static bool ForceWmPaintInPrintWindow { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
if (Environment.Version.Major >= 2)
ActiveXSnapshot.ForceWmPaintInPrintWindow = true;
Methods
BeginResizeNoPaint(Control, Size, out Rectangle)
Temporarily resizes the control without updating the screen. Call EndResizeNoPaint(Control, Rectangle) to switch the control back to regular behavior.
Declaration
public static void BeginResizeNoPaint(Control c, Size size, out Rectangle bounds)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Control | c | The target control. |
System.Drawing.Size | size | The new size. |
System.Drawing.Rectangle | bounds | The saved bounds of the control. |
EndResizeNoPaint(Control, Rectangle)
Ends temporary resizing of a control after you called BeginResizeNoPaint(Control, Size, out Rectangle).
Declaration
public static void EndResizeNoPaint(Control c, Rectangle savedBounds)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Control | c | The target control. |
System.Drawing.Rectangle | savedBounds | The saved bounds of the control. |
FakeLeftMouseClick(Control, Point)
Sends a WM_LBUTTONDOWN and WM_LBUTTONUP message to the control at the specified client coordinates.
Declaration
public static void FakeLeftMouseClick(Control c, Point point)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Control | c | The target control. |
System.Drawing.Point | point | The client coordinates where to simulate the click. |
PrintClient(Control)
Captures the contents of a Windows Forms control using the WM_PRINTCLIENT message.
Declaration
public static Bitmap PrintClient(Control control)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Control | control | The control to be captured. |
Returns
Type | Description |
---|---|
System.Drawing.Bitmap | The bitmap with the display contents of the Windows Forms control. |
PrintControl(Control, Int32, Int32, Size)
Captures the contents of a Windows Forms control using the WM_PRINTCLIENT or WM_PRINT message.
Declaration
public static Bitmap PrintControl(Control control, int msg, int flags, Size size)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Control | control | The control to be captured. |
System.Int32 | msg | WM_PRINT or WM_PRINTCLIENT. |
System.Int32 | flags | Flags used for the WM_PRINT message. |
System.Drawing.Size | size | The size of the window. |
Returns
Type | Description |
---|---|
System.Drawing.Bitmap | The bitmap with the display contents of the Windows Forms control. |
PrintWindow(Control)
Captures the contents of a Windows Forms control using the WM_PRINT message.
Declaration
public static Bitmap PrintWindow(Control control)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Control | control | The control to be captured. |
Returns
Type | Description |
---|---|
System.Drawing.Bitmap | The bitmap with the display contents of the Windows Forms control. |
TakeSnapshot(Object)
Captures the contents of an ActiveX control to a bitmap using the IViewObject interface.
Declaration
public static Bitmap TakeSnapshot(object ocx)
Parameters
Type | Name | Description |
---|---|---|
System.Object | ocx | The ActiveX control. |
Returns
Type | Description |
---|---|
System.Drawing.Bitmap | The bitmap with the display contents of the ActiveX control. |
Remarks
The control must have an implementation of the IViewObject interface.
TakeSnapshot(Object, Boolean)
Captures the contents of an ActiveX control to a bitmap using the IViewObject interface.
Declaration
public static Bitmap TakeSnapshot(object ocx, bool preferViewObject2)
Parameters
Type | Name | Description |
---|---|---|
System.Object | ocx | The ActiveX control. |
System.Boolean | preferViewObject2 | Indicates whether IViewObject2 interface should be used if available. |
Returns
Type | Description |
---|---|
System.Drawing.Bitmap | The bitmap with the display contents of the ActiveX control. |