MarginX Property
MarginX Property |
Gets or sets the x-axis margin around the window rectangle, in screen coordinates.
This margin provides a buffer around the edge of the ink window.
Declaration
[C++]
[C++]
[propput] HRESULT put_MarginX ([in] long MarginX);
[propget] HRESULT get_MarginX ([out, retval] long* MarginX);
[Microsoft® Visual Basic® 6.0]
[Visual Basic]
Public Property Get MarginX() As Long
Public Property Let MarginX(ByVal theMarginX As Long)
Property Value
long The x-axis margin around the window rectangle, in screen coordinates.
This property is read/write.
Return Value
HRESULT value | Description |
---|---|
S_OK | Success. |
E_POINTER | The MarginX parameter is an invalid pointer. |
E_INK_COLLECTOR_ENABLED | Cannot change modes while the collector is enabled. |
E_INK_EXCEPTION | An exception occurred while processing. |
Remarks
This property is most commonly used with nonintegrated tablet devices—the buffer gives users a margin of error when writing on a device that may not map 1 to 1 with the display screen.
The margin is specified in screen coordinates. A positive margin extends outside the context, a negative margin extends inside the context, and a value of zero produces no margin. Ink is collected if the stroke starts within the margin. This behavior does not clip the ink. The context of the object or control is either the window input rectangle from the GetWindowInputRectangle method or the client rectangle for the window.
The margin is effective only within the application's window. If the pen is applied outside the application's window, then the application loses focus and cannot collect ink.
Note: The InkCollector object, the InkOverlay object, or the InkPicture control must be disabled before setting this property. To disable the InkCollector or InkOverlay object, set the Enabled property to FALSE. To disable inking in the InkOverlay control, set the InkEnabled property to FALSE. You can then set the MarginX property, and re-enable the object or control by setting the Enabled property (or InkEnabled property) to TRUE.
Example
[Visual Basic 6.0]
This Visual Basic 6.0 example sets the x-axis margin of a window rectangle for the InkCollector object, theInkCollector.
[Visual Basic]theInkCollector.MarginX = 1
Applies To
- InkCollector Class (Automation Library Reference)
- InkOverlay Class (Automation Library Reference)
- InkPicture Control (Automation Library Reference)