Click here to Skip to main content
15,886,362 members
Home / Discussions / Graphics
   

Graphics

 
GeneralRe: Cross Post! Pin
jainiraj27-Oct-10 4:18
jainiraj27-Oct-10 4:18 
GeneralRe: Cross Post! Pin
Richard MacCutchan27-Oct-10 5:37
mveRichard MacCutchan27-Oct-10 5:37 
QuestionTRUE == FALSE in GDI: Another rtfm? Pin
Tadeusz Westawic22-Oct-10 3:37
Tadeusz Westawic22-Oct-10 3:37 
QuestionFreeing Selected BM from DC in GDI Pin
Tadeusz Westawic17-Oct-10 17:32
Tadeusz Westawic17-Oct-10 17:32 
AnswerRe: Freeing Selected BM from DC in GDI Pin
LunaticFringe17-Oct-10 18:00
LunaticFringe17-Oct-10 18:00 
GeneralRe: Freeing Selected BM from DC in GDI Pin
Tadeusz Westawic17-Oct-10 18:32
Tadeusz Westawic17-Oct-10 18:32 
GeneralRe: Freeing Selected BM from DC in GDI Pin
LunaticFringe18-Oct-10 6:29
LunaticFringe18-Oct-10 6:29 
AnswerRe: Freeing Selected BM from DC in GDI Pin
Sauro Viti18-Oct-10 7:56
professionalSauro Viti18-Oct-10 7:56 
GDI works with handles: HDC for device-contexts, HBITMAP for bitmaps, and so on.
MFC provides a wrapper class for each entity provided by GDI: the CDC class wraps a device-context and internally holds an HDC, the CBitmap class wraps a bitmap and internally holds an HBITMAP and so on.

When you call CDC::SelectObject(), it returns a pointer to the appropriate MFC class that represents the GDI object previously selected into the device-context; these pointers are obtained calling the FromHandle() method (e.g. in case of a bitmap object CBitmap::FromHandle() is called).

The pointers obtained in this way could be temporary because, if your application reach the idle state, i.e. its CWinApp::OnIdle() is called, the objects pointed are deleted; this doesn't mean that the underlaying handle is destroyed, but only that the wrapper class is destroyed. As a conseguence, you cannot store such a pointer to use it later: you should select it back into the device-context before returning from the current message handler.
GeneralRe: Freeing Selected BM from DC in GDI Pin
Tadeusz Westawic19-Oct-10 2:56
Tadeusz Westawic19-Oct-10 2:56 
Questionhow can the diffrent DC share the same OpenGL List? Pin
King Tran5-Oct-10 13:47
King Tran5-Oct-10 13:47 
AnswerRe: how can the diffrent DC share the same OpenGL List? Pin
Peter_in_27805-Oct-10 14:32
professionalPeter_in_27805-Oct-10 14:32 
AnswerRe: how can the diffrent DC share the same OpenGL List? Pin
jk chan27-Dec-10 1:06
jk chan27-Dec-10 1:06 
Questiondiffrent DC share the same OpenGL list Pin
King Tran26-Sep-10 3:52
King Tran26-Sep-10 3:52 
AnswerRe: diffrent DC share the same OpenGL list Pin
Sauro Viti18-Oct-10 7:43
professionalSauro Viti18-Oct-10 7:43 
QuestionHelp) Pin
_Mr_xXx_5-Sep-10 0:49
_Mr_xXx_5-Sep-10 0:49 
QuestionCreating MultiFrame images and dramatic increase in file size Pin
CMTietgen5-Aug-10 16:54
CMTietgen5-Aug-10 16:54 
AnswerRe: Creating MultiFrame images and dramatic increase in file size Pin
LunaticFringe5-Aug-10 23:31
LunaticFringe5-Aug-10 23:31 
GeneralRe: Creating MultiFrame images and dramatic increase in file size Pin
CMTietgen6-Aug-10 1:29
CMTietgen6-Aug-10 1:29 
QuestionOpenGL draw 3D earth with texture Pin
King Tran3-Aug-10 22:57
King Tran3-Aug-10 22:57 
QuestionSorting colors Pin
Nishad S30-Jul-10 2:06
Nishad S30-Jul-10 2:06 
AnswerRe: Sorting colors Pin
Luc Pattyn30-Jul-10 3:05
sitebuilderLuc Pattyn30-Jul-10 3:05 
GeneralRe: Sorting colors Pin
Nishad S30-Jul-10 3:30
Nishad S30-Jul-10 3:30 
QuestionPage layout library Pin
CodeBrain18-Jun-10 23:09
CodeBrain18-Jun-10 23:09 
QuestionDirect2d CB 6.0 error Pin
VovaL3-Jun-10 2:54
VovaL3-Jun-10 2:54 
AnswerRe: Direct2d CB 6.0 error Pin
Luc Pattyn3-Jun-10 3:08
sitebuilderLuc Pattyn3-Jun-10 3:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.