Click here to Skip to main content
15,889,096 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMaking the Disk Defragmenter a Modal dialog Pin
dipuks3-Mar-11 6:17
dipuks3-Mar-11 6:17 
AnswerRe: Making the Disk Defragmenter a Modal dialog Pin
Chris Meech3-Mar-11 6:39
Chris Meech3-Mar-11 6:39 
AnswerRe: Making the Disk Defragmenter a Modal dialog Pin
Luc Pattyn3-Mar-11 7:37
sitebuilderLuc Pattyn3-Mar-11 7:37 
QuestionMac and IP address problem Pin
trioum3-Mar-11 5:14
trioum3-Mar-11 5:14 
QuestionRe: Mac and IP address problem Pin
David Crow3-Mar-11 5:33
David Crow3-Mar-11 5:33 
AnswerRe: Mac and IP address problem Pin
trioum3-Mar-11 6:11
trioum3-Mar-11 6:11 
QuestionRe: Mac and IP address problem Pin
David Crow3-Mar-11 7:25
David Crow3-Mar-11 7:25 
QuestionHow to calculate to get new pixel color by mixing the alpha value with r, g and b value Pin
Amrit Agr2-Mar-11 22:40
Amrit Agr2-Mar-11 22:40 
DWORD destRedColor   = 0;
DWORD destBlueColor  = 0;
DWORD destGreenColor = 0;
DWORD destAlphaColor = 0;
DWORD SrcRedColor     = 0;
DWORD SrcBlueColor    = 0;
DWORD SrcGreenColor   = 0;
DWORD SrcAlphaColor   = 0;
int src_const_alpha   = 0;

// After all the inits we can do the job : Replace Color
for ( int i = ( ( bm.bmWidth * bm.bmHeight ) - 1 ); i >= 0; --i )
 {
	COLORREF clrRef =  ptPixels[i]; //Bitmap pixel color taken with CreateDIBSection's void* lpBits;
	clrRef = COLORREF2RGB( clrRef );
        
        //taking alpha,red,green and blue values.
	DWORD redDest   = GetRValue( clrRef );
	DWORD greenDest = GetGValue( clrRef);
        DWORD blueDest  = GetBValue( clrRef);
	BYTE *ptrAlphaDest = reinterpret_cast<BYTE*>( &clrRef );
	DWORD alphaDest;
	alphaDest = ptrAlphaDest[0];

        //taking alpha,red,green and blue values.
	DWORD redSrc   = GetRValue( _cNewColor ); //Shadow Color ( of user's choice )
	DWORD greensrc = GetGValue( _cNewColor );
        DWORD blueSrc  = GetBValue( _cNewColor );
	BYTE *ptrAlphaSrc = reinterpret_cast<BYTE*>( &_cNewColor );
	DWORD alphaSrc;
	alphaSrc = ptrAlphaSrc[0];

	src_const_alpha  = int( m_intensity * 2.55 );
	SrcRedColor   = redSrc   * src_const_alpha / 255.0;
        SrcGreenColor = greensrc * src_const_alpha / 255.0;
	SrcBlueColor  = blueSrc  * src_const_alpha / 255.0;
	SrcAlphaColor = alphaSrc * src_const_alpha / 255.0;

        destRedColor   = SrcRedColor    + ( 1 - SrcAlphaColor ) * redDest;
	destGreenColor = SrcGreenColor  + ( 1 - SrcAlphaColor ) * greenDest;
	destBlueColor  = SrcBlueColor   + ( 1 - SrcAlphaColor ) * blueDest;
	destAlphaColor = SrcAlphaColor  + ( 1 - SrcAlphaColor ) * alphaDest;

	ptPixels[i]
	= (destAlphaColor << 24 ) |                       
	  (destRedColor   << 16 ) |  
	  (destGreenColor << 8  ) | 
	  (destBlueColor);
}

AnswerRe: How to calculate to get new pixel color by mixing the alpha value with r, g and b value Pin
Richard MacCutchan3-Mar-11 2:08
mveRichard MacCutchan3-Mar-11 2:08 
AnswerRe: How to calculate to get new pixel color by mixing the alpha value with r, g and b value Pin
Andrew Brock3-Mar-11 2:31
Andrew Brock3-Mar-11 2:31 
GeneralRe: How to calculate to get new pixel color by mixing the alpha value with r, g and b value Pin
Amrit Agr3-Mar-11 16:59
Amrit Agr3-Mar-11 16:59 
QuestionUnicode Representation and Transformation Pin
pix_programmer2-Mar-11 21:48
pix_programmer2-Mar-11 21:48 
AnswerRe: Unicode Representation and Transformation Pin
Richard MacCutchan2-Mar-11 23:03
mveRichard MacCutchan2-Mar-11 23:03 
GeneralRe: Unicode Representation and Transformation Pin
pix_programmer3-Mar-11 0:21
pix_programmer3-Mar-11 0:21 
GeneralRe: Unicode Representation and Transformation Pin
CPallini3-Mar-11 1:51
mveCPallini3-Mar-11 1:51 
GeneralRe: Unicode Representation and Transformation Pin
Richard MacCutchan3-Mar-11 2:00
mveRichard MacCutchan3-Mar-11 2:00 
GeneralRe: Unicode Representation and Transformation Pin
CPallini3-Mar-11 2:18
mveCPallini3-Mar-11 2:18 
GeneralRe: Unicode Representation and Transformation Pin
Richard MacCutchan3-Mar-11 3:17
mveRichard MacCutchan3-Mar-11 3:17 
GeneralRe: Unicode Representation and Transformation Pin
CPallini3-Mar-11 3:28
mveCPallini3-Mar-11 3:28 
AnswerRe: Unicode Representation and Transformation Pin
Nemanja Trifunovic3-Mar-11 3:45
Nemanja Trifunovic3-Mar-11 3:45 
QuestionUnhandled exception at EndDialog. Pin
Le@rner2-Mar-11 17:29
Le@rner2-Mar-11 17:29 
AnswerRe: Unhandled exception at EndDialog. Pin
«_Superman_»2-Mar-11 20:18
professional«_Superman_»2-Mar-11 20:18 
GeneralRe: Unhandled exception at EndDialog. Pin
Le@rner2-Mar-11 20:32
Le@rner2-Mar-11 20:32 
GeneralRe: Unhandled exception at EndDialog. Pin
«_Superman_»2-Mar-11 20:35
professional«_Superman_»2-Mar-11 20:35 
GeneralRe: Unhandled exception at EndDialog. Pin
Le@rner2-Mar-11 20:35
Le@rner2-Mar-11 20:35 

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.