开发者

How can i get drawingcontext to draw recatangle with strokes

开发者 https://www.devze.com 2023-03-15 17:24 出处:网络
I need to draw a dashed rectangle on selection of items in an itemcontrol.I am looking for a way to draw a rectangle by DrawingContext.We have got DrawingContext.DrawRectangle and DawingContext.DrawRo

I need to draw a dashed rectangle on selection of items in an itemcontrol.I am looking for a way to draw a rectangle by DrawingContext.We have got DrawingContext.DrawRectangle and DawingContext.DrawRoundedRectangle.But How can开发者_JAVA技巧 we give the properties like Stroke and StrokeDashArray of the Rectangle


When you call DrawingContext.DrawRectangle you should specify the Pen pen parameter which is used to draw stroke. So you can create the Pen instance and set the Pen.DashStyle property.

0

精彩评论

暂无评论...
验证码 换一张
取 消