CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2010

    I must restore the previous bitmap into the device context

    First, thanks for reading this stuf.
    Some days ago I have written a windows ce program where I used double buffering. The problem was that I use a compatible bitmap to produce no flicking.
    My program worked fine but if I leaved it a long time my pda finished without any memory. My program did not waste the memory, it was the system.
    I had a headache until I saw an example that restored inside the compatible dc the previous bitmap, with SelecObject.
    I had never done so with windows api and my programs have worked (or they seemed to work) fine. But at least with windows ce it is needed to work right.
    And my question is: Is it needed in win32 api? Why?
    Thanks in advance.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Hanover Germany

    Re: I must restore the previous bitmap into the device context

    Why not just read what MSDN states in SelectObject function?
    This function returns the previously selected object of the specified type. An application should always replace a new object with the original, default object after it has finished drawing with the new object.
    An application cannot select a single bitmap into more than one DC at a time.
    Victor Nijegorodov

  3. #3
    Join Date
    Nov 2010

    Re: I must restore the previous bitmap into the device context

    Thanks, VictorN.
    You are right. I'll correct my programs.

    Best wishes.

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

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.