How to make a multi-colour dash in WPF (for a polygon) -
i able make dashed polygon in wpf using strokedashedarray property, i.e.,
polygon maskingpolygon = new polygon() maskingpolygon.stroke = brushes.white; maskingpolygon.strokedasharray = new doublecollection() {2,2}; however, can't seem make dash pattern rotates through few different colours. want create dash alternates between black , white. hope functionality this:
polygon maskingpolygon = new polygon() maskingpolygon.strokedasharray = new dictionary<int,brush>(); maskingpolygon.strokedasharray.add(2, white); maskingpolygon.strokedasharray.add(2, black); i need use alternating black , white dashes because polygon needs visible if overlaid on arbitrary photo.
i have illustrated effect desire below using red instead of white visibility.

the hacky way inherit polygon class , create 2 polygons same set of points, 1 dashes overlaid 1 without dashes. that's clumsy.
Comments
Post a Comment