Sdílet prostřednictvím


InkPresenter.ActivateCustomDrying Method

Definition

Indicates that your app requires complete control of ink input rendering.

By default, ink input is processed on a low-latency background thread and rendered "wet" as it is drawn. When the stroke is completed (pen or finger lifted, or mouse button released), the stroke is processed on the UI thread and rendered "dry" to the rendering layer (above the application content and replacing the wet ink).

InkPresenter hosting models

InkCanvas

By calling ActivateCustomDrying (before the InkCanvas is loaded), an app creates an InkSynchronizer object to customize how an ink stroke is rendered dry to a SurfaceImageSource or VirtualSurfaceImageSource. For example, an ink stroke could be rasterized and integrated into application content instead of as a separate InkCanvas layer.

InkDesktopHost (Windows 10 version 1511 and newer)

Win32 apps can host an InkPresenter in an InkDesktopHost using the DirectComposition visual tree.

This requires an IInkD2DRenderer object to manage the ink input (see the Complex ink sample).

CoreInkPresenterHost (Windows 10 Fall Creators Update and newer)

Host an InkPresenter in your own Windows.​UI.​Composition tree without an associated InkCanvas control.

public:
 virtual InkSynchronizer ^ ActivateCustomDrying() = ActivateCustomDrying;
InkSynchronizer ActivateCustomDrying();
public InkSynchronizer ActivateCustomDrying();
function activateCustomDrying()
Public Function ActivateCustomDrying () As InkSynchronizer

Returns

The object used for custom ink stroke rendering.

Remarks

Error codes

E_ILLEGAL_METHOD_CALL (0x8000000E)

Thrown if ActivateCustomDrying is called after InkCanvas is loaded.

This method must be called prior to loading the InkCanvas.

Custom drying and the InkToolbar
By default, ink input is processed on a low-latency background thread and rendered "wet" as it is drawn. When the stroke is completed (pen or finger lifted, or mouse button released), the stroke is processed on the UI thread and rendered "dry" to the InkCanvas layer (above the application content and replacing the wet ink). The ink platform enables you to override this behavior and completely customize the inking experience by custom drying the ink input.

If your app overrides the default ink rendering behavior of the InkPresenter with a custom drying implementation, the rendered ink strokes are no longer available to the InkToolbar and the built-in erase commands of the InkToolbar do not work as expected. To provide erase functionality, you must handle all pointer events, perform hit-testing on each stroke, and override the built-in "Erase all ink" command.

For more info on custom drying, see Pen interactions and Windows Ink in UWP apps.

Applies to

See also