Click here to Skip to main content
15,887,392 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: a managed array cannot have this element type Pin
Cedric Moonen8-Apr-09 4:03
Cedric Moonen8-Apr-09 4:03 
AnswerAsked and answered 2 weeks ago Pin
led mike8-Apr-09 4:23
led mike8-Apr-09 4:23 
QuestionTripleDES ECB in Visual C++ Pin
annese8-Apr-09 2:55
annese8-Apr-09 2:55 
AnswerRe: TripleDES ECB in Visual C++ Pin
Chris Losinger8-Apr-09 6:34
professionalChris Losinger8-Apr-09 6:34 
Questionborder of the childframe Pin
prithaa8-Apr-09 2:36
prithaa8-Apr-09 2:36 
AnswerRe: border of the childframe Pin
Code-o-mat8-Apr-09 2:52
Code-o-mat8-Apr-09 2:52 
GeneralRe: border of the childframe Pin
prithaa8-Apr-09 3:09
prithaa8-Apr-09 3:09 
QuestionHelp with how to add/mix RGBA values Pin
spiffen8-Apr-09 1:17
spiffen8-Apr-09 1:17 
Hi.

I'm currently working on a game where I do some simple pixel modifications when loading graphics. What I tried to do was to build a function that could take two RGBA values and add them, but I'm having real trouble with the alpha values. I know how to do it when using only RGB colors but when including alpha everything gets much trickier. I would like to have a function like this:


u32 blendPixel(u32 baseColor, u32 paintColor) {
    u8 baseRed = getRed(baseColor);
    u8 baseGreen = getGreen(baseColor);
    u8 baseBlue = getBlue(baseColor);
    u8 baseAlpha = getAlpha(baseColor);

    u8 paintRed = getRed(paintColor);
    u8 paintGreen = getGreen(paintColor);
    u8 paintBlue = getBlue(paintColor);
    u8 paintAlpha = getAlpha(paintColor);

    u8 newRed = ???
    u8 newGreen = ???
    u8 newBlue = ???
    u8 newAlpha = ???

    return makecol(newRed, newGreen, newBlue, newAlpha);
}

AnswerRe: Help with how to add/mix RGBA values Pin
Iain Clarke, Warrior Programmer8-Apr-09 1:24
Iain Clarke, Warrior Programmer8-Apr-09 1:24 
GeneralRe: Help with how to add/mix RGBA values Pin
spiffen8-Apr-09 2:22
spiffen8-Apr-09 2:22 
GeneralRe: Help with how to add/mix RGBA values Pin
Iain Clarke, Warrior Programmer8-Apr-09 2:32
Iain Clarke, Warrior Programmer8-Apr-09 2:32 
GeneralRe: Help with how to add/mix RGBA values Pin
spiffen8-Apr-09 4:16
spiffen8-Apr-09 4:16 
GeneralRe: Help with how to add/mix RGBA values Pin
Iain Clarke, Warrior Programmer8-Apr-09 6:00
Iain Clarke, Warrior Programmer8-Apr-09 6:00 
GeneralRe: Help with how to add/mix RGBA values Pin
Iain Clarke, Warrior Programmer8-Apr-09 2:34
Iain Clarke, Warrior Programmer8-Apr-09 2:34 
GeneralRe: Help with how to add/mix RGBA values Pin
CPallini8-Apr-09 7:19
mveCPallini8-Apr-09 7:19 
QuestionHow to convert LZW type tiff file to PDF c++? Pin
raesa8-Apr-09 0:58
raesa8-Apr-09 0:58 
AnswerRe: How to convert LZW type tiff file to PDF c++? Pin
Rajesh R Subramanian8-Apr-09 1:07
professionalRajesh R Subramanian8-Apr-09 1:07 
AnswerRe: How to convert LZW type tiff file to PDF c++? Pin
Jijo.Raj8-Apr-09 1:13
Jijo.Raj8-Apr-09 1:13 
GeneralRe: How to convert LZW type tiff file to PDF c++? Pin
raesa8-Apr-09 1:38
raesa8-Apr-09 1:38 
GeneralRe: How to convert LZW type tiff file to PDF c++? Pin
Rajesh R Subramanian8-Apr-09 2:02
professionalRajesh R Subramanian8-Apr-09 2:02 
GeneralRe: How to convert LZW type tiff file to PDF c++? Pin
Stuart Dootson8-Apr-09 2:40
professionalStuart Dootson8-Apr-09 2:40 
GeneralRe: How to convert LZW type tiff file to PDF c++? Pin
raesa8-Apr-09 17:40
raesa8-Apr-09 17:40 
QuestionRapi use for connect with active sync,now what can i use for connect with Mobile Device Center? Pin
Le@rner8-Apr-09 0:54
Le@rner8-Apr-09 0:54 
QuestionDouble to CString Pin
Davitor7-Apr-09 23:57
Davitor7-Apr-09 23:57 
AnswerRe: Double to CString Pin
«_Superman_»7-Apr-09 23:59
professional«_Superman_»7-Apr-09 23:59 

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.