Click here to Skip to main content
15,888,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDuplicate Function - Linker Error LNK2005 Pin
Mike Certini2-Apr-12 9:30
Mike Certini2-Apr-12 9:30 
QuestionRe: Duplicate Function - Linker Error LNK2005 Pin
Richard MacCutchan2-Apr-12 21:25
mveRichard MacCutchan2-Apr-12 21:25 
QuestionCCommandLineInfo and parsing command line arguments. Pin
Maximilien2-Apr-12 3:47
Maximilien2-Apr-12 3:47 
AnswerRe: CCommandLineInfo and parsing command line arguments. Pin
Richard MacCutchan2-Apr-12 4:06
mveRichard MacCutchan2-Apr-12 4:06 
QuestionRe: CCommandLineInfo and parsing command line arguments. Pin
Maximilien2-Apr-12 4:34
Maximilien2-Apr-12 4:34 
AnswerRe: CCommandLineInfo and parsing command line arguments. Pin
Richard MacCutchan2-Apr-12 4:42
mveRichard MacCutchan2-Apr-12 4:42 
AnswerRe: CCommandLineInfo and parsing command line arguments. Pin
Jochen Arndt2-Apr-12 4:18
professionalJochen Arndt2-Apr-12 4:18 
QuestionTransparentBlt not showing background correctly Pin
Codling20202-Apr-12 3:39
Codling20202-Apr-12 3:39 
Hello,
I've created a button that displays a CBitmap, and switches to a different bitmap when pressed.

I now want to add transparency, allowing the dialog background to show through in certain places.

To do this, I have set a background image on the dialog by overriding the OnEraseBkgnd() method.

The button draw code is called from the dialog OnDrawItem. The drawing code then updates the buttons pCwnd DC (obtained from GetDlgItem, GetDC).

- The DC creates a compatible DC from realDC.
- The DC select-object's a bitmap (realDC compatiblebitmap)
- TransparentBlt a bitmap to the DC
- BitBlt the DC to the realDC


For non-transparent buttons, the above works fine. When there is transparency in the button image, the background doesnt show. Instead, there are smears, or a portion of the previous bitmap remains (when changing from non-transparent to transparent when it is clicked).

I thought I needed an 'Invalidate(TRUE)', not really sure. I tried calling it but it just refreshes the transparent portion to whatever it was before (generally a black/white smear).

Can anyone see any issues with the steps I mentioned above?

TIA.


[EDIT] Using MFC on WinCE.
AnswerRe: TransparentBlt not showing background correctly Pin
Code-o-mat2-Apr-12 5:04
Code-o-mat2-Apr-12 5:04 
GeneralRe: TransparentBlt not showing background correctly Pin
Codling20202-Apr-12 5:37
Codling20202-Apr-12 5:37 
GeneralRe: TransparentBlt not showing background correctly Pin
Code-o-mat2-Apr-12 6:12
Code-o-mat2-Apr-12 6:12 
GeneralRe: TransparentBlt not showing background correctly Pin
Codling20202-Apr-12 6:35
Codling20202-Apr-12 6:35 
GeneralRe: TransparentBlt not showing background correctly Pin
Code-o-mat2-Apr-12 6:43
Code-o-mat2-Apr-12 6:43 
QuestionHow to check iterator for NULL Pin
KASR12-Apr-12 2:24
KASR12-Apr-12 2:24 
AnswerRe: How to check iterator for NULL Pin
Maximilien2-Apr-12 2:46
Maximilien2-Apr-12 2:46 
GeneralRe: How to check iterator for NULL Pin
KASR12-Apr-12 2:53
KASR12-Apr-12 2:53 
GeneralRe: How to check iterator for NULL Pin
Maximilien2-Apr-12 3:00
Maximilien2-Apr-12 3:00 
GeneralRe: How to check iterator for NULL Pin
KASR12-Apr-12 3:24
KASR12-Apr-12 3:24 
GeneralRe: How to check iterator for NULL Pin
KASR12-Apr-12 4:28
KASR12-Apr-12 4:28 
AnswerRe: How to check iterator for NULL Pin
Stephen Hewitt3-Apr-12 7:34
Stephen Hewitt3-Apr-12 7:34 
QuestionMapping logical drive to its physical drive Pin
VCProgrammer1-Apr-12 19:56
VCProgrammer1-Apr-12 19:56 
AnswerRe: Mapping logical drive to its physical drive Pin
Richard MacCutchan1-Apr-12 22:44
mveRichard MacCutchan1-Apr-12 22:44 
QuestionHow to change the variable type on the fly? Pin
Falconapollo1-Apr-12 7:17
Falconapollo1-Apr-12 7:17 
AnswerRe: How to change the variable type on the fly? Pin
Software_Developer1-Apr-12 8:49
Software_Developer1-Apr-12 8:49 
GeneralRe: How to change the variable type on the fly? Pin
Falconapollo1-Apr-12 15:28
Falconapollo1-Apr-12 15:28 

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.