合并CanvasRenderingContext2D中的多个路径以作为集合填充和描边 [英] Merge multiple paths in CanvasRenderingContext2D to fill and stroke as a set
问题描述
我目前正在使用CanvasRenderingContext2D中的路径绘制一组重叠的形状。这很好用但是我现在想要将所有这些路径联合起来,这样当我使用半透明颜色填充时,重叠不会显示。此外,我想描绘联合形状的轮廓。关于如何实现这一目标的任何建议?
谢谢Mark但我认为我找到了更好的方法来做到这一点。 / p>
我在空白的bitmapdata上绘制我的形状,然后将其用作alpha蒙版......
I am currently drawing a set of overlapping shapes using paths in a CanvasRenderingContext2D. This works well however I would now like to unite all these paths so that when I fill using a semi-transparent color the overlapping is not shown. Also I would like to stroke the contour of the united shapes. Any suggestions on how to achieve this?
Thank you Mark however I think I have found a better way to do this.
I draw my shapes on a blank bitmapdata and then use it as an alpha mask...
这篇关于合并CanvasRenderingContext2D中的多个路径以作为集合填充和描边的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!