问题描述
第一个问题:众所周知,我们可以使用"DrawFocusRect
"例程在窗体的画布上绘制虚线矩形.我想知道它是如何工作的.
通常,我们通过将笔的模式设置为"Xor"或"NotXor"来绘制橡胶矩形(可以在鼠标移动时调整大小),然后用这支笔绘制直线矩形,但是这种模式有一个缺点,那就是仅适用于纯色底色形式,或者当底色的底画布是彩色图片时,这种方式将失败.
但是例程"DrawFocusRect
()"喜欢在窗体的画布上方绘制虚线矩形,并且不会影响背景色.
它是如何工作的?能否在调用此例程之前将其笔或画笔属性设置为模式,样式,颜色等?
QQQ给出任何答案或建议...
First Q: As we know, we can use the "DrawFocusRect
" routine to draw a dotted line-rect "on" a form''s canvas. I want to know how does it work.
Usually, we draw rubber rect(which can be resized while mouse moving) via setting the pen''s mode to "Xor" or "NotXor" and then draw a line-rect with this pen, but this pattern takes an disadvantage, it only works in pure-color-back form or rather, when the form''s back canvas was a colorful picture, this way would fail.
But the routine "DrawFocusRect
()" likes to draw dotted line-rect above a form''s canvas and do not impact the back color.
How does it work? And can we set its pen or brush attributes as mode,style,color etc before call this routine?
QQQ for any answer or advice...
这篇关于图形界面:DrawFocusRect-等待IT巨人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!