Uwp 如何设置InkCanvas笔颜色的笔划不透明度?

Uwp 如何设置InkCanvas笔颜色的笔划不透明度?,uwp,inkcanvas,Uwp,Inkcanvas,如何设置UWP中墨迹笔划的不透明度?您可以设置的不透明度属性以实现目标 例如: public主页() { this.InitializeComponent(); inkCanvas.InkPresenter.InputDeviceTypes= Windows.UI.Core.CoreInputDeviceTypes.Mouse| Windows.UI.Core.CoreInputDeviceTypes.Pen; InkDrawingAttribute铅笔属性=InkDrawingAttrib

如何设置UWP中墨迹笔划的不透明度?

您可以设置的不透明度属性以实现目标

例如:


public主页()
{
this.InitializeComponent();
inkCanvas.InkPresenter.InputDeviceTypes=
Windows.UI.Core.CoreInputDeviceTypes.Mouse|
Windows.UI.Core.CoreInputDeviceTypes.Pen;
InkDrawingAttribute铅笔属性=InkDrawingAttribute.CreateForPencil();
pencilAttributes.Color=Windows.UI.Colors.Red;
尺寸=新窗口。基础。尺寸(3, 3);
铅笔属性.PencilProperties.Opacity=0.5f;
inkCanvas.InkPresenter.UpdateDefaultDrawingAttribute(铅笔属性);
}