I must restore the previous bitmap into the device context
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

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

  1. #1
    Join Date
    Nov 2010
    Posts
    3

    I must restore the previous bitmap into the device context

    Hi,
    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
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,466

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

    Why not just read what MSDN states in SelectObject function?
    Remarks
    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
    Posts
    3

    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

This is a CodeGuru survey question.


Featured


HTML5 Development Center