What's the different between Begin paint and GetDC ?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: What's the different between Begin paint and GetDC ?

  1. #1
    Join Date
    Jun 2003
    Posts
    58

    What's the different between Begin paint and GetDC ?

    I usually used GetDC, never used Begin Paint to paint something in WM_PAINT.
    what's the different ?
    and which one is faster ?

  2. #2
    Join Date
    Feb 2003
    Location
    California
    Posts
    334
    BeginPaint() does a little more than GetDC(). For instance, it automatically validates the regions that have been invalidated. Because it sets up clipping regions so that you won't paint in areas that are not invalidated, BeginPaint() will often be faster than GetDC().

    I use GetDC() when painting but not in response to a WM_PAINT message. For instance, if I set up a timer to animate a sprite or something, you have to use GetDC(). However, for the reasons stated above, I always use BeginPaint() in response to WM_PAINT.
    Henri Hein
    Principal Engineer, Propel
    Do not credit Propel with my views or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center