简体   繁体   中英

Draw a “L” using the DrawingContext

I need to Draw (using System.Windows.Media.DrawingContext ) a " L " in WPF. What is the optimal way to proceed?

Draw 2 lines? Draw a 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...
I need to draw , not to use Templates or Decorators.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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