Click here to Skip to main content
15,918,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Answerbut you are you shouting ???? Pin
Anonymous29-Apr-05 20:23
Anonymous29-Apr-05 20:23 
GeneralRe: but you are you shouting ???? Pin
ThatsAlok29-Apr-05 21:22
ThatsAlok29-Apr-05 21:22 
AnswerRe: HOW TO DETACT MULTIPLE VGA CARDS IN VC++ Pin
David Crow30-Apr-05 6:33
David Crow30-Apr-05 6:33 
GeneralProblem with flipping DDraw surfaces Pin
Kieroshark29-Apr-05 17:21
Kieroshark29-Apr-05 17:21 
Generaldesign membership function Pin
Anonymous29-Apr-05 17:21
Anonymous29-Apr-05 17:21 
GeneralBinary Waveform Pin
gremouster29-Apr-05 16:41
gremouster29-Apr-05 16:41 
QuestionHow to display bitmap bit data from memory? Pin
mikec++29-Apr-05 13:06
mikec++29-Apr-05 13:06 
AnswerRe: How to display bitmap bit data from memory? Pin
Shog929-Apr-05 14:25
sitebuilderShog929-Apr-05 14:25 
DIBSections are pretty easy. You specify what you want (using a BITMAPINFO structure, like you already are), and Windows gives you memory that you can write to. You just pass in a pointer to the pointer you want to use to reference this:
unsigned char* pBmpData = NULL;
HBITMAP hBmp = CreateDIBSection(hDC, pbmInfo, DIB_RGB_COLORS, (void**)&pBmpData, NULL, 0);

Then you just need to copy your bitmap data into the memory Windows allocated for you:
memcpy(pBmpData, &aBitmapBits[0], NumOfBytes);


And you're ready to do something fun with your new bitmap. Don't forget to delete the bitmap when you're done with it though (using DeleteObject())... and that'll free the memory used as well, so don't be using that pointer afterwards. Enjoy!

Medication for us all
You think you know me, well you're wrong

GeneralRe: How to display bitmap bit data from memory? Pin
mikec++29-Apr-05 14:56
mikec++29-Apr-05 14:56 
GeneralRe: How to display bitmap bit data from memory? Pin
mikec++29-Apr-05 16:00
mikec++29-Apr-05 16:00 
Generalnon-member function threading Pin
outoolcoe29-Apr-05 12:56
outoolcoe29-Apr-05 12:56 
Generalpipes of CreateProcess() Pin
includeh1029-Apr-05 11:20
includeh1029-Apr-05 11:20 
GeneralParsing XML file Pin
Reveur129-Apr-05 10:28
Reveur129-Apr-05 10:28 
GeneralDisplay a disabled 24-bit image Pin
eddya29-Apr-05 9:44
eddya29-Apr-05 9:44 
GeneralRe: Display a disabled 24-bit image Pin
bmzhao29-Apr-05 14:19
bmzhao29-Apr-05 14:19 
QuestionWhy make a function 'static'? Pin
Chris Meech29-Apr-05 9:35
Chris Meech29-Apr-05 9:35 
AnswerRe: Why make a function 'static'? Pin
David Crow29-Apr-05 9:43
David Crow29-Apr-05 9:43 
GeneralRe: Why make a function 'static'? Pin
Chris Meech2-May-05 2:11
Chris Meech2-May-05 2:11 
AnswerRe: Why make a function 'static'? Pin
BambooMoon29-Apr-05 9:50
BambooMoon29-Apr-05 9:50 
AnswerRe: Why make a function 'static'? Pin
Blake Miller29-Apr-05 10:44
Blake Miller29-Apr-05 10:44 
GeneralRe: Why make a function 'static'? Pin
Chris Meech2-May-05 2:16
Chris Meech2-May-05 2:16 
GeneralWMI Pin
Alex_Y29-Apr-05 9:01
Alex_Y29-Apr-05 9:01 
GeneralRe: WMI Pin
Alexander M.,29-Apr-05 9:04
Alexander M.,29-Apr-05 9:04 
GeneralRe: WMI Pin
Alex_Y2-May-05 2:12
Alex_Y2-May-05 2:12 
GeneralRe: WMI Pin
David Crow29-Apr-05 9:35
David Crow29-Apr-05 9: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.