Click here to Skip to main content
15,898,949 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can I use AlphaBlend API to display a transparent background bitmap? Pin
danginkgo8-Jul-08 21:35
danginkgo8-Jul-08 21:35 
GeneralRe: How can I use AlphaBlend API to display a transparent background bitmap? Pin
SandipG 8-Jul-08 21:38
SandipG 8-Jul-08 21:38 
GeneralRe: How can I use AlphaBlend API to display a transparent background bitmap? Pin
danginkgo8-Jul-08 21:49
danginkgo8-Jul-08 21:49 
GeneralRe: How can I use AlphaBlend API to display a transparent background bitmap? Pin
SandipG 8-Jul-08 22:35
SandipG 8-Jul-08 22:35 
GeneralRe: How can I use AlphaBlend API to display a transparent background bitmap? Pin
danginkgo8-Jul-08 22:40
danginkgo8-Jul-08 22:40 
AnswerRe: How can I use AlphaBlend API to display a transparent background bitmap? Pin
Paresh Chitte8-Jul-08 20:50
Paresh Chitte8-Jul-08 20:50 
GeneralRe: How can I use AlphaBlend API to display a transparent background bitmap? Pin
danginkgo8-Jul-08 20:53
danginkgo8-Jul-08 20:53 
AnswerRe: How can I use AlphaBlend API to display a transparent background bitmap? Pin
Iain Clarke, Warrior Programmer8-Jul-08 22:25
Iain Clarke, Warrior Programmer8-Jul-08 22:25 
Changing direction for the solution, I wrote some software a while ago that put together irregular chunks of bitmaps (a jigsaw game).

pDC->SetTextColor (RGB(255,255,255));
pDC->SetBkColor (RGB(0,0,0));
pDC->BitBlt (pt.x, pt.y, m_rcOriginal.Width () + (2*m_nBorderSize), m_rcOriginal.Height () + (2*m_nBorderSize), &m_dcMaskBW, 0,0, SRCAND);
pDC->BitBlt (pt.x, pt.y, m_rcOriginal.Width () + (2*m_nBorderSize), m_rcOriginal.Height () + (2*m_nBorderSize), &m_dcTile, 0,0, SRCPAINT);


The SetText/BkColor are because the source DC was a 1bit colour depth DC, and acted as a mask. The background was white, and the middle area was black. So it made a black area on the destination.

The second BitBlt ORed in a DC which had the interesting bits of the picture. The area I wanted to be transparent was black, not grey.

This would mean adapting your code to two DCs, but that should not be too hard. It also would not work if you wanted partial transparency, but it does not appear that you do.

Lastly, you could get flicker if you were unlucky - so my whole drawing code is wrapped using Keith Rule's excellent CMemDC class.

Flicker Free Drawing In MFC[^]

Iain.

Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.

GeneralRe: How can I use AlphaBlend API to display a transparent background bitmap? Pin
danginkgo9-Jul-08 0:22
danginkgo9-Jul-08 0:22 
AnswerRe: How can I use AlphaBlend API to display a transparent background bitmap? Pin
Mark Salsbery9-Jul-08 5:46
Mark Salsbery9-Jul-08 5:46 
Questionsending CList using WM_COPYDATA for interprocess communication Pin
Prasann Mayekar8-Jul-08 20:26
Prasann Mayekar8-Jul-08 20:26 
AnswerRe: sending CList using WM_COPYDATA for interprocess communication Pin
SandipG 8-Jul-08 20:50
SandipG 8-Jul-08 20:50 
AnswerRe: sending CList using WM_COPYDATA for interprocess communication Pin
Varghese Paul M8-Jul-08 23:14
Varghese Paul M8-Jul-08 23:14 
AnswerRe: sending CList using WM_COPYDATA for interprocess communication Pin
Mark Salsbery9-Jul-08 5:33
Mark Salsbery9-Jul-08 5:33 
QuestionBlue border displayed while using dhtml control_Url asignment Pin
chetanjoshi98-Jul-08 19:43
chetanjoshi98-Jul-08 19:43 
QuestionCompatibility issue Pin
V K 28-Jul-08 19:18
V K 28-Jul-08 19:18 
AnswerRe: Compatibility issue Pin
Stephen Hewitt8-Jul-08 19:59
Stephen Hewitt8-Jul-08 19:59 
GeneralRe: Compatibility issue Pin
V K 28-Jul-08 20:15
V K 28-Jul-08 20:15 
GeneralRe: Compatibility issue Pin
Stephen Hewitt8-Jul-08 20:22
Stephen Hewitt8-Jul-08 20:22 
GeneralRe: Compatibility issue Pin
V K 28-Jul-08 20:53
V K 28-Jul-08 20:53 
GeneralRe: Compatibility issue Pin
Stephen Hewitt8-Jul-08 20:59
Stephen Hewitt8-Jul-08 20:59 
QuestionQuestion about icon on CButton Pin
xanagan6668-Jul-08 18:28
xanagan6668-Jul-08 18:28 
AnswerRe: Question about icon on CButton Pin
Iain Clarke, Warrior Programmer8-Jul-08 22:56
Iain Clarke, Warrior Programmer8-Jul-08 22:56 
Questionstack trace in exception Pin
George_George8-Jul-08 16:43
George_George8-Jul-08 16:43 
AnswerRe: stack trace in exception Pin
Sarath C8-Jul-08 18:22
Sarath C8-Jul-08 18:22 

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.