用边框绘制粗线 [英] Draw thick line with border
问题描述
可能重复:
用边框绘制粗线
使用c ++的粗线,并从所有边添加边框到此线。
我使用moveto,lineto函数,但不知道如何跟踪线宽来绘制边框。
I am trying to draw a thick line using c++, and add a border to this line from all side. I am using moveto, lineto functions, but not sure how to track the line width to draw borders.
推荐答案
你的线路是什么方式?如果是水平/垂直,那么粗线是一个矩形, Rectangle()绘制一个使用当前笔勾出并使用当前画笔填充的矩形,以便您可以一行做边框。
但是如果你想要一个通用的行,任意角度,让我是第一个指出,这不会是任何用途,在这种情况下,菲律宾的建议。
What way does your line go? If it is horizontal / vertical, then a "thick line" is a rectangle, and Rectangle() draws a rectangle "outlined by using the current pen and filled by using the current brush", so you can do line with a border in one go. However if you want a generic line, at arbitrary angles, let me be the first to point out that this won't be any use, in which case go for Philipp's suggestion.
这篇关于用边框绘制粗线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!