public InkExample() { this.InitializeComponent(); inkCanvas.InkPresenter.InputDeviceTypes = Windows.UI.Core.CoreInputDeviceTypes.Mouse | Windows.UI.Core.CoreInputDeviceTypes.Pen | Windows.UI.Core.CoreInputDeviceTypes.Touch; // By default, pen barrel button or right mouse button is processed for inking // Set the configuration to instead allow processing these input on the UI thread inkCanvas.InkPresenter.InputProcessingConfiguration.RightDragAction = InkInputRightDragAction.LeaveUnprocessed; inkCanvas.InkPresenter.UnprocessedInput.PointerPressed += UnprocessedInput_PointerPressed; inkCanvas.InkPresenter.UnprocessedInput.PointerMoved += UnprocessedInput_PointerMoved; inkCanvas.InkPresenter.UnprocessedInput.PointerReleased += UnprocessedInput_PointerReleased; inkCanvas.InkPresenter.StrokeInput.StrokeStarted += StrokeInput_StrokeStarted; inkCanvas.InkPresenter.StrokesCollected += InkPresenter_StrokesCollected; inkCanvas.InkPresenter.StrokesErased += InkPresenter_StrokesErased; inkSynchronizer = inkCanvas.InkPresenter.ActivateCustomDrying(); textFormat = new CanvasTextFormat(); // Set defaults SelectedDryInkRenderingType = DryInkRenderingType.BuiltIn; SelectColor(color0); showTextLabels = true; needToCreateSizeDependentResources = true; }
public InkExample() { this.InitializeComponent(); inkCanvas.InkPresenter.InputDeviceTypes = Windows.UI.Core.CoreInputDeviceTypes.Mouse | Windows.UI.Core.CoreInputDeviceTypes.Pen | Windows.UI.Core.CoreInputDeviceTypes.Touch; // By default, pen barrel button or right mouse button is processed for inking // Set the configuration to instead allow processing these input on the UI thread inkCanvas.InkPresenter.InputProcessingConfiguration.RightDragAction = InkInputRightDragAction.LeaveUnprocessed; inkCanvas.InkPresenter.UnprocessedInput.PointerPressed += UnprocessedInput_PointerPressed; inkCanvas.InkPresenter.UnprocessedInput.PointerMoved += UnprocessedInput_PointerMoved; inkCanvas.InkPresenter.UnprocessedInput.PointerReleased += UnprocessedInput_PointerReleased; inkCanvas.InkPresenter.StrokeInput.StrokeStarted += StrokeInput_StrokeStarted; inkCanvas.InkPresenter.StrokesCollected += InkPresenter_StrokesCollected; inkCanvas.InkPresenter.StrokesErased += InkPresenter_StrokesErased; inkSynchronizer = inkCanvas.InkPresenter.ActivateCustomDrying(); textFormat = new CanvasTextFormat(); // Set defaults SelectedDryInkRenderingType = DryInkRenderingType.BuiltIn; SelectColor(color0); showTextLabels = true; needToCreateSizeDepdendentResources = true; }
public InkExample() { this.InitializeComponent(); inkCanvas.InkPresenter.InputDeviceTypes = Windows.UI.Core.CoreInputDeviceTypes.Mouse | Windows.UI.Core.CoreInputDeviceTypes.Pen | Windows.UI.Core.CoreInputDeviceTypes.Touch; // By default, pen barrel button or right mouse button is processed for inking // Set the configuration to instead allow processing these input on the UI thread inkCanvas.InkPresenter.InputProcessingConfiguration.RightDragAction = InkInputRightDragAction.LeaveUnprocessed; inkCanvas.InkPresenter.UnprocessedInput.PointerPressed += UnprocessedInput_PointerPressed; inkCanvas.InkPresenter.UnprocessedInput.PointerMoved += UnprocessedInput_PointerMoved; inkCanvas.InkPresenter.UnprocessedInput.PointerReleased += UnprocessedInput_PointerReleased; inkCanvas.InkPresenter.StrokeInput.StrokeStarted += StrokeInput_StrokeStarted; inkCanvas.InkPresenter.StrokesCollected += InkPresenter_StrokesCollected; inkSynchronizer = inkCanvas.InkPresenter.ActivateCustomDrying(); inkAttributes = inkCanvas.InkPresenter.CopyDefaultDrawingAttributes(); inkAttributes.Size = new Size(10, inkAttributes.Size.Height); if (isPencilSupported) { pencilAttributes = InkDrawingAttributes.CreateForPencil(); pencilAttributes.Size = new Size(10, pencilAttributes.Size.Height); pencilAttributes.PencilProperties.Opacity = 2; } else { usePencilCheckbox.Visibility = Visibility.Collapsed; } textFormat = new CanvasTextFormat(); // Set defaults SelectedDryInkRenderingType = DryInkRenderingType.BuiltIn; SelectColor(color0); showTextLabels = true; needToCreateSizeDependentResources = true; }