Click here to Skip to main content
15,895,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CImage to HBITMAP Pin
Liorsh1-Jan-02 0:50
Liorsh1-Jan-02 0:50 
GeneralRe: CImage to HBITMAP Pin
Christian Graus1-Jan-02 1:01
protectorChristian Graus1-Jan-02 1:01 
GeneralRe: CImage to HBITMAP Pin
Philip Patrick1-Jan-02 6:10
professionalPhilip Patrick1-Jan-02 6:10 
GeneralHBITMAP & open file Pin
Matt Newman31-Dec-01 16:21
Matt Newman31-Dec-01 16:21 
GeneralRe: HBITMAP & open file Pin
Michael Dunn31-Dec-01 21:33
sitebuilderMichael Dunn31-Dec-01 21:33 
GeneralRe: HBITMAP & open file Pin
Matt Newman1-Jan-02 4:54
Matt Newman1-Jan-02 4:54 
GeneralRe: HBITMAP & open file Pin
Matt Newman1-Jan-02 6:53
Matt Newman1-Jan-02 6:53 
GeneralI guess yes... Pin
Philip Patrick1-Jan-02 8:49
professionalPhilip Patrick1-Jan-02 8:49 
... The CBitmap object is destroyed after this function ends, and the HBITMAP inside it released too. Maybe this is the problem.
I found this somewhere in the samples of Platform SDK:
m_cPic is the CStatic here

HBITMAP hbm = (HBITMAP)::LoadImage(AfxGetApp()->m_hInstance,
     MAKEINTRESOURCE(IDB_MAP),
     IMAGE_BITMAP, 0, 0, LR_LOADTRANSPARENT);
m_cPic.SetBitmap(hbm);



This works fine in my test project and loads the bitmap as transparent (pixel 1,1 is the trans color)
Also. I noticed that you have to make size of your CStatic on the dialog same or greater than the size of that bitmap.

Philip Patrick
"Two beer or not two beer?" <shakesbeer>
Web-site: www.saintopatrick.com
GeneralRe: I guess yes... Pin
Matt Newman1-Jan-02 9:34
Matt Newman1-Jan-02 9:34 
GeneralRe: HBITMAP & open file Pin
Michael Dunn1-Jan-02 9:36
sitebuilderMichael Dunn1-Jan-02 9:36 
GeneralProblem with loading DLL on a computer that doesn't have VC++ installed... Pin
Rickard Andersson2031-Dec-01 14:21
Rickard Andersson2031-Dec-01 14:21 
GeneralRe: Problem with loading DLL on a computer that doesn't have VC++ installed... Pin
Roger Wright (new)31-Dec-01 16:16
Roger Wright (new)31-Dec-01 16:16 
GeneralRe: Problem with loading DLL on a computer that doesn't have VC++ installed... Pin
Not Active31-Dec-01 23:01
mentorNot Active31-Dec-01 23:01 
GeneralRe: Problem with loading DLL on a computer that doesn't have VC++ installed... Pin
Rickard Andersson201-Jan-02 1:57
Rickard Andersson201-Jan-02 1:57 
GeneralRe: Problem with loading DLL on a computer that doesn't have VC++ installed... Pin
The_Server1-Jan-02 2:47
The_Server1-Jan-02 2:47 
GeneralRe: Problem with loading DLL on a computer that doesn't have VC++ installed... Pin
Rickard Andersson201-Jan-02 4:53
Rickard Andersson201-Jan-02 4:53 
Generalwin32 API with c# Pin
kasturirawat31-Dec-01 13:55
kasturirawat31-Dec-01 13:55 
GeneralAuto URL detect Pin
Nnamdi Onyeyiri31-Dec-01 7:40
Nnamdi Onyeyiri31-Dec-01 7:40 
GeneralCompiling DLL in Release Mode Pin
Nnamdi Onyeyiri31-Dec-01 7:37
Nnamdi Onyeyiri31-Dec-01 7:37 
GeneralStatic Binding & Dynamic Binding :: C++ Pin
valikac31-Dec-01 7:15
valikac31-Dec-01 7:15 
GeneralRe: Static Binding & Dynamic Binding :: C++ Pin
Christian Graus31-Dec-01 10:42
protectorChristian Graus31-Dec-01 10:42 
GeneralRe: Static Binding & Dynamic Binding :: C++ Pin
valikac31-Dec-01 11:56
valikac31-Dec-01 11:56 
GeneralRe: Static Binding & Dynamic Binding :: C++ Pin
2-Jan-02 7:56
suss2-Jan-02 7:56 
GeneralRe: Static Binding & Dynamic Binding :: C++ Pin
valikac2-Jan-02 14:22
valikac2-Jan-02 14:22 
GeneralGraph Pin
Sonu Kapoor31-Dec-01 5:09
Sonu Kapoor31-Dec-01 5:09 

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.