Omit an edge from a shape in WPF (C# code)?
I'm creating a speech bubble control for my application, and the way I'm looking to do it is to use a rectangle with rounded corners, then place a shape on top that forms the "origin" of the speech bubble. These are arranged in a Grid so that the bubble resizes to its content whilst keeping the origin shape constant (ie it won't stretch). Now, here's my question; is it possible to create a Path in WPF with one of the sides omitted (ie so the stroke is omitted from that edge, but the fill is still present)?
I know I could do it by placing 2 shapes on top of each other, but I'm looking for a solution that's as simple as possible!
Thanks, Lee.
Yes, it's possible. You just omit one of the edges. The Fill will still be applied inside the shape:
<Path Fill="Beige" Stroke="Black" Data="M 0,0 L 20,0 L 0,20"></Path>
链接地址: http://www.djcxy.com/p/61692.html
上一篇: 在NSView的OSX中用Core Graphics绘制车速表
下一篇: 从WPF中的形状(C#代码)省略边缘?