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.
Re: I must restore the previous bitmap into the device context
Why not just read what MSDN states in SelectObject function?
Quote:
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.
Re: I must restore the previous bitmap into the device context
Thanks, VictorN.
You are right. I'll correct my programs.
Best wishes.