如何在UWP中设置InkCanvas上的笔划不透明度属性
我试过了,但没有成功:如何在UWP中设置InkCanvas上的笔划不透明度属性,uwp,inkcanvas,Uwp,Inkcanvas,我试过了,但没有成功: var drawingAttributes = inkCanvas.InkPresenter.CopyDefaultDrawingAttributes(); drawingAttributes.Color =Color.FromArgb(100,0,0,0); inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes); 上面的代码正确更改了颜色,但忽略了alpha通道。我
var drawingAttributes = inkCanvas.InkPresenter.CopyDefaultDrawingAttributes();
drawingAttributes.Color =Color.FromArgb(100,0,0,0);
inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
上面的代码正确更改了颜色,但忽略了alpha通道。我不想使用荧光笔,因为它的不透明度是固定的,需要调整它的大小(它比笔的大小大)
我不想使用荧光笔,因为它的不透明度是固定的,需要调整它的大小(它比笔的大小大)
还有类的属性。因此,您可以获取或设置用于在InkCanvas上渲染铅笔笔划的透明度级别。请参考以下代码
InkDrawingAttributes pencilAttributes = InkDrawingAttributes.CreateForPencil();
pencilAttributes.Color = Windows.UI.Colors.Red;
pencilAttributes.Size = new Windows.Foundation.Size(3, 3);
pencilAttributes.PencilProperties.Opacity = 0.5f;
// Update InkPresenter with the pencil attributes.
inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(pencilAttributes);
我不想使用荧光笔,因为它的不透明度是固定的,需要调整它的大小(它比笔的大小大)
还有类的属性。因此,您可以获取或设置用于在InkCanvas上渲染铅笔笔划的透明度级别。请参考以下代码
InkDrawingAttributes pencilAttributes = InkDrawingAttributes.CreateForPencil();
pencilAttributes.Color = Windows.UI.Colors.Red;
pencilAttributes.Size = new Windows.Foundation.Size(3, 3);
pencilAttributes.PencilProperties.Opacity = 0.5f;
// Update InkPresenter with the pencil attributes.
inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(pencilAttributes);
谢谢,但这并不能解决问题,因为铅笔不是钢笔。我正在考虑设置不透明度,同时让笔划完全填充。谢谢,但这并不能解决问题,因为铅笔不是钢笔。我正在考虑设置不透明度,同时让笔划完全填充。