UnfitElf
September 20th, 2006, 11:39 PM
Hi people,
Im wondering about this and im not clear on what the msdn states..
// Example #1
HGDIOBJ hOld = SelectObject(blaHdc, something1);
SelectObject(blaHdc, something2);
SelectObject(blaHdc, something3);
SelectObject(blaHdc, something4);
// Do something ....
// Clean up
SelectObject(blaHdc, hOld);
//------------------------------------
// Or Example #2
HGDIOBJ hOld = SelectObject(blaHdc, something1);
SelectObject(blaHdc, hOld);
hOld = SelectObject(blaHdc, something2);
SelectObject(blaHdc, hOld);
hOld = SelectObject(blaHdc, something3);
SelectObject(blaHdc, hOld);
//etc.
Do u have to put the original object back into the DC everytime before you want to put a new object in it, or can u simply take a very first returned object then do whatever and put the first returned one back at the end?
To have to replace it with the old one every single time you need to select a new object doesnt really make sence to me, but beter to be safe than sorry ;)
Thanks for any help :)
Im wondering about this and im not clear on what the msdn states..
// Example #1
HGDIOBJ hOld = SelectObject(blaHdc, something1);
SelectObject(blaHdc, something2);
SelectObject(blaHdc, something3);
SelectObject(blaHdc, something4);
// Do something ....
// Clean up
SelectObject(blaHdc, hOld);
//------------------------------------
// Or Example #2
HGDIOBJ hOld = SelectObject(blaHdc, something1);
SelectObject(blaHdc, hOld);
hOld = SelectObject(blaHdc, something2);
SelectObject(blaHdc, hOld);
hOld = SelectObject(blaHdc, something3);
SelectObject(blaHdc, hOld);
//etc.
Do u have to put the original object back into the DC everytime before you want to put a new object in it, or can u simply take a very first returned object then do whatever and put the first returned one back at the end?
To have to replace it with the old one every single time you need to select a new object doesnt really make sence to me, but beter to be safe than sorry ;)
Thanks for any help :)