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.

multi-colour dash illustration

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


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -