Several blogs about Delphi operation XML

Source: Internet
Author: User

Http://www.cnblogs.com/acuier a whole more than 10 articles, save me to study, learn a bit can.

Test color:

Found WM_PAINT message processing, since found, then the WM_PAINT message also accounted for an account, so all wndproc above all normal end. Unless the twincontrol.wmpaint inside continues to perform complex calls, the button1.update is done.  Procedure Twincontrol.wmpaint (var message:twmpaint); var DC, Memdc:hdc;  Membitmap, Oldbitmap:hbitmap; Ps:tpaintstruct;begin//Note, here is the redraw handle control, redrawing the graphic control is not here//Fixme don't know when it is double buffered if not fdoublebuffered or (MESSAGE.DC <> 0    Then BEGIN//Do not count yourself as a child control, so this function is used to redraw the child controls. If you want to paint yourself, you have to cover the paint in addition, but send a message to the child controls to redraw the matter, which has helped the programmer to write (the child controls themselves or to overwrite the paint; To ensure the correct drawing of their own)//note cscustompaint This style if not (cscust Ompaint in ControlState) and (controlcount = 0) then inherited//dentures, the parent has no related function at all and does nothing.  Fixme, as if by the parent class to re-draw their own else painthandler (Message);   Generally go here, trim and redraw all child controls (send WM_PAINT messages) end ELSE begin//Prepare the memory artboard, there is no canvas at this time, so use the API old method DC: = GetDC (0); The parameter 0 represents the DC Membitmap that obtains the entire screen: = CreateCompatibleBitmap (DC, Clientrect.right, Clientrect.bottom); Create an artboard for the current DC (presumably to keep the display outside of the current window, as in the artboard's Backplane) ReleaseDC (0, DC); Leave Membitmap, then release the entire screen of DC MEMDC: = CreateCOMPATIBLEDC (0); Create a compatible DC Oldbitmap for the current DC: = SelectObject (MEMDC, Membitmap); Put the MEMBITMAP board into the MEMDC, you can prepare to draw a try DC in the MEMDC: = BeginPaint (Handle, PS); The return value is the DC//double buffering work for the specified window to really start Perform (WM_ERASEBKGND, MEMDC, MEMDC);  The current control uses MEMDC erase background message.dc: = MEMDC; Constructs a message, passes in the MEMDC, the current control and the child control both draw Wmpaint (Message) on the MEMDC;  Recursive call function (build a message, but not a message), and at this time the DC is not equal to 0, so the condition is established, into the block execution Painthandler MESSAGE.DC: = 0; The message is used, the message parameter is reset, but all the data obtained by the message is MEMDC in//drawing the memory artboard, ready to switch BitBlt (DC, 0, 0, clientrect.right, Clientrect.bottom, MemD C, 0, 0, srccopy); Copy the MEMDC of all controls once to the DC EndPaint (Handle, PS) of the specified window;      End Drawing Process finally SelectObject (MEMDC, Oldbitmap);      DeleteDC (MEMDC);    DeleteObject (MEMBITMAP);  End End;end;

  

Several blogs about Delphi operation XML

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.