Click here to Skip to main content
15,904,339 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: OnLButtonDown Pin
Aint13-Mar-07 18:37
Aint13-Mar-07 18:37 
GeneralRe: OnLButtonDown Pin
Parthi_Appu13-Mar-07 19:10
Parthi_Appu13-Mar-07 19:10 
GeneralRe: OnLButtonDown Pin
Aint13-Mar-07 20:06
Aint13-Mar-07 20:06 
GeneralRe: OnLButtonDown Pin
Hamid_RT13-Mar-07 20:23
Hamid_RT13-Mar-07 20:23 
AnswerRe: OnLButtonDown Pin
William.Wang13-Mar-07 19:21
William.Wang13-Mar-07 19:21 
QuestionAlphaBlend() strange colors. Pin
PatrykDabrowski13-Mar-07 13:05
PatrykDabrowski13-Mar-07 13:05 
QuestionRe: AlphaBlend() strange colors. Pin
Mark Salsbery13-Mar-07 16:04
Mark Salsbery13-Mar-07 16:04 
QuestionRe: AlphaBlend() strange colors. Pin
PatrykDabrowski20-Mar-07 2:01
PatrykDabrowski20-Mar-07 2:01 
Sorry, I couldn't reply as I was offline for couple of days. I was trying CDC::AlphaBlend(), CImage::AlphaBlend() and global ::AlphaBlend() with the same results.

I discovered that I should premultiply r/g/b values by alpha channel. Now it works fine, but I wonder how to cope with the situation when You have very small r/g/b values and small alpha channel. When You premultiply those small values and divide by 255, You will get zeroes...Now if You want to recover almost transparent pixels by increasing their alpha value, You will get black color instead of original one?!?!?

Am I correct??

Simple example:

Source bitmap: ARGB(10,20,0,0) ; DARK RED
After premultiply: ARGB(10,20*10/255,0,0) = ARGB(10,0,0,0); BLACK

Now try to recover original color by increasing alpha
ARGB(255,0,0,0) and You receive black instead of ARGB(255,20,0,0);

Thanks for Your attention.

AnswerRe: AlphaBlend() strange colors. Pin
Mark Salsbery20-Mar-07 7:45
Mark Salsbery20-Mar-07 7:45 
Questioncompatibility problem Pin
duca_andrei13-Mar-07 11:11
duca_andrei13-Mar-07 11:11 
AnswerRe: compatibility problem Pin
Paresh Chitte13-Mar-07 18:37
Paresh Chitte13-Mar-07 18:37 
QuestionClearing data Pin
eRose2413-Mar-07 11:10
eRose2413-Mar-07 11:10 
QuestionRe: Clearing data Pin
prasad_som13-Mar-07 15:45
prasad_som13-Mar-07 15:45 
AnswerRe: Clearing data Pin
Hamid_RT13-Mar-07 18:20
Hamid_RT13-Mar-07 18:20 
Questionscrollbar problem Pin
prithaa13-Mar-07 9:25
prithaa13-Mar-07 9:25 
AnswerRe: scrollbar problem Pin
Mark Salsbery13-Mar-07 16:09
Mark Salsbery13-Mar-07 16:09 
GeneralRe: scrollbar problem Pin
prithaa13-Mar-07 18:44
prithaa13-Mar-07 18:44 
GeneralRe: scrollbar problem Pin
Mark Salsbery14-Mar-07 6:04
Mark Salsbery14-Mar-07 6:04 
Questioncin issue Pin
Programm3r13-Mar-07 8:48
Programm3r13-Mar-07 8:48 
AnswerRe: cin issue Pin
Programm3r13-Mar-07 8:57
Programm3r13-Mar-07 8:57 
QuestionRe: cin issue Pin
David Crow13-Mar-07 9:16
David Crow13-Mar-07 9:16 
AnswerRe: cin issue Pin
CPallini13-Mar-07 10:05
mveCPallini13-Mar-07 10:05 
GeneralRe: cin issue Pin
Cedric Moonen13-Mar-07 10:32
Cedric Moonen13-Mar-07 10:32 
GeneralRe: cin issue Pin
CPallini13-Mar-07 12:11
mveCPallini13-Mar-07 12:11 
GeneralRe: cin issue Pin
Stephen Hewitt13-Mar-07 15:43
Stephen Hewitt13-Mar-07 15:43 

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.