Click here to Skip to main content
15,894,180 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Listbox control Pin
srija23-Apr-06 7:02
srija23-Apr-06 7:02 
Questionreading strings from file - newbie Pin
antonaras_marcou22-Apr-06 1:23
antonaras_marcou22-Apr-06 1:23 
AnswerRe: reading strings from file - newbie Pin
Stephen Hewitt22-Apr-06 1:46
Stephen Hewitt22-Apr-06 1:46 
GeneralRe: reading strings from file - newbie Pin
antonaras_marcou22-Apr-06 2:07
antonaras_marcou22-Apr-06 2:07 
GeneralRe: reading strings from file - newbie Pin
Stephen Hewitt22-Apr-06 2:10
Stephen Hewitt22-Apr-06 2:10 
AnswerRe: reading strings from file - newbie Pin
Michael Dunn22-Apr-06 9:12
sitebuilderMichael Dunn22-Apr-06 9:12 
GeneralRe: reading strings from file - newbie Pin
Stephen Hewitt22-Apr-06 18:51
Stephen Hewitt22-Apr-06 18:51 
QuestionPlacing transparent bitmaps into dialogs Pin
Rafael Fernández López22-Apr-06 1:04
Rafael Fernández López22-Apr-06 1:04 
Hi,

I want to put a semi-transparent bitmap into my dialog, and I've the following code:

BLENDFUNCTION bf;
bf.AlphaFormat = 0;
bf.BlendFlags = 0;
bf.BlendOp = AC_SRC_OVER;
bf.SourceConstantAlpha = 0x7f;

CRect rect;
GetDlgItem(IDC_PRUEBA_TRANS)->GetWindowRect(&rect);

CClientDC dc(this);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);

AlphaBlend(GetDlgItem(IDC_PRUEBA_TRANS)->GetDC()->GetSafeHdc(), 0, 0, rect.Width(), rect.Height(), dc, 0, 0, rect.Width(), rect.Height(), bf);

This code purpose was to test if AlphaBlend is working all-right with my dialog, and it seem that it does.

Now my problem is: I've bitmaps as "BITMAPS" in my resource file. IDC_PRUEBA_TRANS is a CStatic Ctrl with Bitmap enabled and a Bitmap loaded through designer (not code). If I do such:

AlphaBlend(dc, 0, 0, rect.Width(), rect.Height(), dcMem, 0, 0, rect.Width(), rect.Height(), bf);

The transparent bitmap will be drawn on the opaque one, so the transparency will not be visible (for that reason, I tried to put a form shot into IDC_PRUEBA_TRANS, to test it).

So I'd like to know how can I get a CDC from a CBitmap or whatever way of do this thing...

Thank you,
Rafael Fernández López.


Written by: Rafael Fernández López.


Visit: http://www.maestroprogramador.com

AnswerRe: Placing transparent bitmaps into dialogs Pin
John R. Shaw22-Apr-06 18:37
John R. Shaw22-Apr-06 18:37 
QuestionProperty Sheet Problem Pin
si_6921-Apr-06 23:42
si_6921-Apr-06 23:42 
AnswerRe: Property Sheet Problem Pin
includeh1022-Apr-06 4:40
includeh1022-Apr-06 4:40 
GeneralRe: Property Sheet Problem Pin
si_6922-Apr-06 11:58
si_6922-Apr-06 11:58 
Questionhow can i get my app path? Pin
Sina Parastgary21-Apr-06 23:29
Sina Parastgary21-Apr-06 23:29 
AnswerRe: how can i get my app path? Pin
Naveen21-Apr-06 23:40
Naveen21-Apr-06 23:40 
AnswerRe: how can i get my app path? Pin
Michael Dunn22-Apr-06 9:14
sitebuilderMichael Dunn22-Apr-06 9:14 
QuestionUsing OLE IStream in a thread Pin
Waldermort21-Apr-06 23:27
Waldermort21-Apr-06 23:27 
AnswerRe: Using OLE IStream in a thread Pin
Stephen Hewitt22-Apr-06 0:32
Stephen Hewitt22-Apr-06 0:32 
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 0:46
Waldermort22-Apr-06 0:46 
GeneralRe: Using OLE IStream in a thread Pin
Stephen Hewitt22-Apr-06 1:08
Stephen Hewitt22-Apr-06 1:08 
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 1:58
Waldermort22-Apr-06 1:58 
GeneralRe: Using OLE IStream in a thread Pin
Stephen Hewitt22-Apr-06 2:01
Stephen Hewitt22-Apr-06 2:01 
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 2:14
Waldermort22-Apr-06 2:14 
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 2:41
Waldermort22-Apr-06 2:41 
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 3:36
Waldermort22-Apr-06 3:36 
GeneralRe: Using OLE IStream in a thread Pin
Stephen Hewitt22-Apr-06 3:51
Stephen Hewitt22-Apr-06 3:51 

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.