Click here to Skip to main content
15,911,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRecursive CFileFind problem [modified] Pin
Mr_Gbg3-Mar-11 6:43
Mr_Gbg3-Mar-11 6:43 
AnswerRe: Recursive CFileFind problem Pin
Frank Seidler3-Mar-11 7:30
Frank Seidler3-Mar-11 7:30 
QuestionRe: Recursive CFileFind problem Pin
David Crow3-Mar-11 8:07
David Crow3-Mar-11 8:07 
AnswerRe: Recursive CFileFind problem Pin
Luc Pattyn3-Mar-11 8:47
sitebuilderLuc Pattyn3-Mar-11 8:47 
GeneralRe: Recursive CFileFind problem Pin
David Crow3-Mar-11 9:08
David Crow3-Mar-11 9:08 
GeneralRe: Recursive CFileFind problem Pin
Luc Pattyn3-Mar-11 9:18
sitebuilderLuc Pattyn3-Mar-11 9:18 
GeneralRe: Recursive CFileFind problem Pin
Mr_Gbg3-Mar-11 21:57
Mr_Gbg3-Mar-11 21:57 
QuestionRe: Recursive CFileFind problem Pin
David Crow3-Mar-11 8:05
David Crow3-Mar-11 8:05 
AnswerRe: Recursive CFileFind problem Pin
Mr_Gbg3-Mar-11 9:39
Mr_Gbg3-Mar-11 9:39 
AnswerRe: Recursive CFileFind problem Pin
Luc Pattyn3-Mar-11 9:32
sitebuilderLuc Pattyn3-Mar-11 9:32 
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 
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 
Perhaps elaborate on what you are trying to do so that we can help you better.

Also note that Bitmap pictures pad each scanline to a multiple of 4 bytes.
If your bitmaps are 32bit, then you can ignore this.
That is if your picture is 5 pixels wide, each pixel taking 3 bytes (24 bits) then each scanline would be 5 * 3 = 15bytes wide.
Since that is not a multiple of 4 some bytes (1 in this case) are added to align the next scanline.

Note: The MSDN page for BITMAP[^] says they are WORD (2 byte) aligned, but from previous experience I have found that they are DWORD (4 byte) aligned.

This means that you must iterate through bm.bmHeight, and then for each iteration of that, iterate through bm.bmWidth.

BYTE *pBitmapData = (BYTE *)XXX; //XXX is the value from CreateDIBSection
int nBytesPerPixel = bm.bmBitsPixel / 8;
for (int y = 0; y < bm.bmHeight; ++y) {
	for (int x = 0; x < bm.bmWidth; ++x) {
		COLORREF clrRef = *((COLORREF *)pBitmapData);
		//blend images somehow
		pBitmapData += nBytesPerPixel; //Simply skip to the next pixel
	}
	pBitmapData += (nBytesPerPixel * bm.bmHeight + 3) & 3; //Round up to the next DWORD.
}

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 

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.