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