Click here to Skip to main content
15,927,921 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Catching dynamically created CStatic windows messages Pin
Fernando A. Gomez F.7-Jul-06 5:14
Fernando A. Gomez F.7-Jul-06 5:14 
QuestionOwner drawn button matrix Pin
cshell496-Jul-06 13:33
cshell496-Jul-06 13:33 
AnswerRe: Owner drawn button matrix Pin
Justin Tay6-Jul-06 21:54
Justin Tay6-Jul-06 21:54 
QuestionMultithread Prime Directive Compliance [modified] Pin
quasinormalized6-Jul-06 12:22
quasinormalized6-Jul-06 12:22 
AnswerRe: Multithread Prime Directive Compliance Pin
Gary R. Wheeler6-Jul-06 14:52
Gary R. Wheeler6-Jul-06 14:52 
GeneralRe: Multithread Prime Directive Compliance Pin
Ryan Binns6-Jul-06 19:20
Ryan Binns6-Jul-06 19:20 
GeneralRe: Multithread Prime Directive Compliance Pin
quasinormalized7-Jul-06 4:58
quasinormalized7-Jul-06 4:58 
QuestionProblem with alphablending Pin
Luksky6-Jul-06 11:17
Luksky6-Jul-06 11:17 
I'd like to display a few bitmaps as layers, something like in Adobe Photoshop. First to display one bitmap (layer), then alphablend next bitmap (layer) and then next, and next, and... To do this I prepered array of 32_bit_per_pixel bitmaps (with alpha channel): HBITMAP hBitmaps[10];.

Code looks like this:

	BLENDFUNCTION m_blend;<br />
	m_blend.BlendOp = AC_SRC_OVER;<br />
	m_blend.BlendFlags = 0;<br />
	m_blend.SourceConstantAlpha = 255;<br />
	m_blend.AlphaFormat = AC_SRC_ALPHA;<br />
<br />
	i = 0;<br />
	while( i<n )<br />
	{<br />
		dcTmp.SelectObject( hBitmaps[i++] );<br />
<br />
		AlphaBlend( dcLayout.m_hDC,<br />
			x, y, uWidth, uHeight,<br />
			dcTmp.m_hDC,<br />
			0, 0, uWidth, uHeight, <br />
			m_blend );<br />
	}


Creating these bitmaps I'm using is OK. Alphablending is also working OK when bitmaps has alpha channel set to 255 for each pixel.

But there seem to be a problem, when bitmaps has transparent alpha channel. I also want to display transparent layer (later user will be able to draw on this layer). Each pixel in this transparent layer has alpha channel with value = 0 (so it's totaly transparent).
When this layer is filled with white color RGB(255,255,255) it isn't transparent, but when is filled with, for example, RGB(200,0,0) or RGB(0,0,0), then layer is transparent but not totaly, only in 80-90%! :/

I also see that: when layer is a photography or some picture pixels with alpha channel less then 255 are not partly transparent but partly white! :/

I dont't know what I may do wrong. Can you help me?

~~~~
AnswerRe: Problem with alphablending Pin
Hamid_RT6-Jul-06 19:20
Hamid_RT6-Jul-06 19:20 
QuestionWhy do we need heap allocation? [modified] Pin
sawerr6-Jul-06 11:07
sawerr6-Jul-06 11:07 
AnswerRe: Why do we need heap allocation? Pin
Chris Losinger6-Jul-06 11:25
professionalChris Losinger6-Jul-06 11:25 
GeneralRe: Why do we need heap allocation? Pin
sawerr6-Jul-06 11:44
sawerr6-Jul-06 11:44 
GeneralRe: Why do we need heap allocation? [modified] Pin
Chris Losinger6-Jul-06 12:07
professionalChris Losinger6-Jul-06 12:07 
GeneralRe: Why do we need heap allocation? Pin
sawerr6-Jul-06 12:30
sawerr6-Jul-06 12:30 
GeneralRe: Why do we need heap allocation? Pin
Chris Losinger6-Jul-06 15:24
professionalChris Losinger6-Jul-06 15:24 
QuestionClass exported from a DLL Pin
Jay036-Jul-06 10:55
Jay036-Jul-06 10:55 
AnswerRe: Class exported from a DLL Pin
led mike6-Jul-06 11:15
led mike6-Jul-06 11:15 
GeneralRe: Class exported from a DLL Pin
Jay036-Jul-06 11:41
Jay036-Jul-06 11:41 
QuestionLooking for a C++ programmer Pin
roland516-Jul-06 10:31
roland516-Jul-06 10:31 
AnswerRe: Looking for a C++ programmer Pin
led mike6-Jul-06 10:49
led mike6-Jul-06 10:49 
GeneralRe: Looking for a C++ programmer Pin
ThatsAlok6-Jul-06 18:45
ThatsAlok6-Jul-06 18:45 
AnswerRe: Looking for a C++ programmer Pin
peterchen6-Jul-06 10:54
peterchen6-Jul-06 10:54 
AnswerRe: Looking for a C++ programmer [modified] Pin
Joe Woodbury6-Jul-06 12:20
professionalJoe Woodbury6-Jul-06 12:20 
AnswerRe: Looking for a C++ programmer Pin
John M. Drescher6-Jul-06 15:56
John M. Drescher6-Jul-06 15:56 
QuestionProblems with throw exception definition in comutil.h Pin
Alex Cutovoi6-Jul-06 8:30
Alex Cutovoi6-Jul-06 8:30 

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.