WPF/Silverlight:是否可以为每个边缘设置不同的笔触颜色? [英] WPF/Silverlight: Is it possible to have a different stroke color for each edge?

查看:24
本文介绍了WPF/Silverlight:是否可以为每个边缘设置不同的笔触颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个具有特定笔触颜色的矩形.我可以定义某些边缘以具有不同的颜色吗?例如,假设我希望笔触的顶部和底部是一种颜色,但笔触的左侧和右侧是不同的颜色?

Say I have a rectangle with a certain stroke color. Can I define certain edges to have different colors? For example, say I want the top and bottom of the stroke to be one color, but the left and right of the stroke to be a different color?

如果这是不可能的,你知道什么好方法吗?

If this is not possible, do you know of a good way?

推荐答案

我最终做到了这一点,我将两个边框重叠在一起.我会相应地调整边框粗细.

I ended up doing this by having two borders one on top of eachother. And I adjust the border thicknesses accordingly.

这篇关于WPF/Silverlight:是否可以为每个边缘设置不同的笔触颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆