Click here to Skip to main content
16,020,182 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: help me pls... Pin
Christian Graus21-Aug-06 22:10
protectorChristian Graus21-Aug-06 22:10 
GeneralRe: help me pls... Pin
Christian Graus21-Aug-06 22:07
protectorChristian Graus21-Aug-06 22:07 
GeneralRe: help me pls... Pin
naddy^pell21-Aug-06 22:22
naddy^pell21-Aug-06 22:22 
GeneralRe: help me pls... Pin
Christian Graus21-Aug-06 22:41
protectorChristian Graus21-Aug-06 22:41 
GeneralRe: help me pls... Pin
Hamid Taebi22-Aug-06 1:15
professionalHamid Taebi22-Aug-06 1:15 
AnswerRe: help me pls... Pin
Hamid Taebi21-Aug-06 20:57
professionalHamid Taebi21-Aug-06 20:57 
QuestionLocalization using Mlang.dll Pin
sunitha_nd21-Aug-06 18:05
sunitha_nd21-Aug-06 18:05 
QuestionBitmap bits Pin
Waldermort21-Aug-06 18:02
Waldermort21-Aug-06 18:02 
I'm trying to read the pixels of a monochrome bitmap (1-bit per pixel). I am so close to getting it right but I just cannot produce the same results as GetPixel(). I use GetBitmapBits() to read the bits into a byte array, then loop through attemptng to read a bit at a time. My output is somewhat 'blocky'.
for (y=0;y<height;y++)
	{
		for (x=0;x<width;x++)
		{
			ULONG col = GetPixel(hBuf,x,y);
			if (col)
				SetPixel(hdc,width+x,y,RGB(0,0,255));

			int offset = y * b.bmWidthBytes + x / 8;
			BYTE pixel = *(BYTE *)(lpBits + offset) >> x%7;
			if ((pixel & 0x01) == 0x01)
				SetPixel(hdc,width+width+x,y,RGB(0,0,255));
		}
	}

This is maybe my 15th version of the loop, I'm sure I am reading it bit by bit, I can't work out whats going wrong.
AnswerRe: Bitmap bits Pin
jk chan21-Aug-06 18:42
jk chan21-Aug-06 18:42 
GeneralRe: Bitmap bits Pin
Waldermort21-Aug-06 18:58
Waldermort21-Aug-06 18:58 
AnswerRe: Bitmap bits Pin
Justin Tay21-Aug-06 19:26
Justin Tay21-Aug-06 19:26 
GeneralRe: Bitmap bits Pin
Waldermort21-Aug-06 20:28
Waldermort21-Aug-06 20:28 
QuestionLocalisation in WIN32 , fails Pin
spicy_kid200021-Aug-06 17:19
spicy_kid200021-Aug-06 17:19 
AnswerRe: Localisation in WIN32 , fails Pin
Joe Woodbury21-Aug-06 17:48
professionalJoe Woodbury21-Aug-06 17:48 
AnswerRe: Localisation in WIN32 , fails Pin
Waldermort21-Aug-06 18:21
Waldermort21-Aug-06 18:21 
GeneralRe: Localisation in WIN32 , fails Pin
Joe Woodbury21-Aug-06 19:08
professionalJoe Woodbury21-Aug-06 19:08 
GeneralRe: Localisation in WIN32 , fails Pin
Waldermort21-Aug-06 19:15
Waldermort21-Aug-06 19:15 
GeneralRe: Localisation in WIN32 , fails Pin
Joe Woodbury21-Aug-06 19:21
professionalJoe Woodbury21-Aug-06 19:21 
QuestionPerspective Projection Opengl Pin
jk chan21-Aug-06 16:41
jk chan21-Aug-06 16:41 
AnswerRe: Perspective Projection Opengl Pin
Steve Echols21-Aug-06 18:52
Steve Echols21-Aug-06 18:52 
GeneralRe: Perspective Projection Opengl Pin
jk chan21-Aug-06 19:17
jk chan21-Aug-06 19:17 
GeneralRe: Perspective Projection Opengl Pin
Steve Echols21-Aug-06 19:52
Steve Echols21-Aug-06 19:52 
GeneralRe: Perspective Projection Opengl Pin
jk chan21-Aug-06 20:21
jk chan21-Aug-06 20:21 
GeneralRe: Perspective Projection Opengl Pin
Steve Echols21-Aug-06 20:53
Steve Echols21-Aug-06 20:53 
GeneralRe: Perspective Projection Opengl Pin
jk chan21-Aug-06 20:59
jk chan21-Aug-06 20: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.