简体   繁体   English

使用DrawingContext绘制一个“ L”

[英]Draw a “L” using the DrawingContext

I need to Draw (using System.Windows.Media.DrawingContext ) a " L " in WPF. 我需要在WPF中使用System.Windows.Media.DrawingContext绘制一个“ L ”。 What is the optimal way to proceed? 最佳的进行方式是什么?

Draw 2 lines? 画两条线? Draw a PolyLineSegment ? 绘制PolyLineSegment (not sure how) (不确定如何)

drawContext.DrawLine(myPen, topLeft, New Point(topLeft.X + 5, topLeft.Y))
drawContext.DrawLine(myPen, topLeft, New Point(topLeft.X, topLeft.Y + 5))

Actually, I need to surround a label with visible corners "L"-like... 实际上,我需要在标签周围加上可见的“ L”形转角...
I need to draw , not to use Templates or Decorators. 我需要绘制而不要使用模板或装饰器。

如果您的问题是向自己的DrawingContext添加尽可能少的Drawing对象,则可以填充StreamGeometry并通过DrawGeometry对其进行绘制

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM