tags:

views:

113

answers:

2

Hello, is it possible to set the corner radius of a WPF polyline to a custom value. For a WPF border it is possible. In my opinion, the polyline can only set StrokeLineJoin="Round", but not the radius:

<Polyline Points="0,0 0,100 200,100" StrokeLineJoin="Round" />

For border: CornerRadius="..." is possible:

<Border CornerRadius="8" ... />

Is there an easy workaround/hack to achieve custom corner roundings (at line joins) of polylines? (e.g. Microsoft Visio is able to do this.) Thanks!

A: 

Not that I know of but their is a hack... create your border or rectangle with corner radius set using expression blend and then convert to path? This will take a rectangle (with a corner radius set) and make it a path!

rudigrobler
Interesting approach.But what if polyline angles are not always 90 degree? I need a way to show a polyline dynamically with customized rounded corners or without. What is the mathematic algorithm to show e.g. a rectangle with rounded corners (like visio). I think it is not just an arc at the corners?!
A: 

See http://www.charlespetzold.com/blog/2008/04/Rounded-Graphics-in-WPF.html for the win.

Alex Paven
Thanks. But this is not what I need. I would like to post an image to clarify but have no rights to do so....