WinForms中有没有关于绘制循环的文档?WinForms绘画循环文档?
当我在Windows AM程序油漆周期通常的形式:
sent a WM_PAINT message
{
call BeginPaint(&paintStruct)
//BeginPaint sends WM_NCPAINT and WM_ERASEBKGND
sent a WM_ERASEBKGND message
{
i can:
- allow default processing (Windows will fill the area with the default background color (e.g. white)
- erase and background myself (e.g. a gradient) and prevent default processing
- do nothing (letting whatever was there before me stay there) and prevent default processing
}
perform whatever painting i desire on
paintStruct.hDC (Device Context)
paintStruct.rcPaint (Invalid Rectangle)
that was populated into paintStruct during BeginPaint
call EndPaint()
}
这是所有记录在MSDN:Windows Development\Graphics and Multimedia\Windows GDI\Painting and Drawing\About Painting and Drawing
我无法找到有关的WinForms任何这样的文件及其涂料周期。我可以随意找到方法和具有名称油漆在这些事件:
OnPaint
(保护法“引发Paint事件。”)OnPrint
(保护法“引发Paint事件。”)- InvokePaint(受保护的方法 “引发为指定的控件Paint事件”。)
Paint
(公共事件)InvokePaintBackground
(受保护的方法“引发排ntBackground事件指定控件“)OnPaintBackground
(保护法 ”绘制控件的背景“)
注意:。忽略了一个事实,没有
PaintBackground
事件
是否有文档描述这些实体之间的设计关系? WinForms中有没有关于绘制循环的文档?
我们在这里开始陷入缺乏文档,但'UserPaint'文档说“如果为false,则不会引发Paint事件。”这是否意味着'Paint事件'不会引发?或者这意味着'OnPaint'方法不会被调用?我注意到'不透明'(“如果为true,控件被绘制为不透明并且背景未被绘制”)会对'OnPaintBackground'产生任何影响。我看到更多:'AllPaintingInWmPaint'' OptimizedDoubleBuffer'。 – 2011-04-23 15:09:22
我打算接受杰森的回答。严格地说,我要求提供文件。虽然MSDN文档可能非常不足,但这正是我一直在寻找的。虽然这个答案对于MSDN的补充非常有用(+1)。 – 2011-04-23 15:10:31