Click here to Skip to main content
15,894,343 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Rewind in a serialize process? Pin
José Luis Sogorb11-Dec-01 6:01
José Luis Sogorb11-Dec-01 6:01 
GeneralRe: Rewind in a serialize process? Pin
Ravi Bhavnani12-Dec-01 1:57
professionalRavi Bhavnani12-Dec-01 1:57 
GeneralRe: Rewind in a serialize process? Pin
José Luis Sogorb12-Dec-01 6:09
José Luis Sogorb12-Dec-01 6:09 
GeneralRe: Rewind in a serialize process? Pin
José Luis Sogorb13-Dec-01 3:33
José Luis Sogorb13-Dec-01 3:33 
GeneralGet image into DIB Pin
Jerry Wang11-Dec-01 4:27
Jerry Wang11-Dec-01 4:27 
GeneralRe: Get image into DIB Pin
PJ Arends11-Dec-01 9:08
professionalPJ Arends11-Dec-01 9:08 
GeneralRe: Get image into DIB Pin
Jerry Wang12-Dec-01 7:56
Jerry Wang12-Dec-01 7:56 
GeneralRe: Get image into DIB Pin
PJ Arends12-Dec-01 13:16
professionalPJ Arends12-Dec-01 13:16 
Ok, if I understand you correctly, what you have is the dimensions of a bitmap (width and height), and an array of BYTEs specifying the data bits for a 32 bit bitmap, but you do not have the bitmap itself.

You can create the bitmap using the CreateDIBitmap() or CreateDIBSection() functions. The HDC used just has to a HDC compatible with the screen.

HDC DC = ::CreateCompatibleDC(NULL);

BITMAPINFO bmi;
::ZeroMemory(&bmi, sizeof(BITMAPINFO));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = width;
bmi.bmiHeader.biHeight = height;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitcount = 32;
bmi.bmiHeader.biCompression = BI_RGB;
bmi.bmiHeader.biSizeImage = width * height * 4;

void *dummy;
HBITMAP hDIB = ::CreateDIBSection(DC, &bmi, DIB_RGB_COLORS, &dummy, NULL, 0);
::SetDIBits(DC, hDIB, 0, height, Pointer_to_Data_Bits_Array, &bmi, DIB_RGB_COLORS);



---
It may be that your sole purpose in life is simply to serve as a warning to others.
GeneralRe: Get image into DIB Pin
13-Dec-01 12:06
suss13-Dec-01 12:06 
GeneralAutomation in Outlook Pin
JDMoore11-Dec-01 4:13
JDMoore11-Dec-01 4:13 
QuestionHow to determine if IIS is installed and version? Pin
Matt Philmon11-Dec-01 3:52
Matt Philmon11-Dec-01 3:52 
AnswerRe: Problem solving skill! Pin
Masaaki Onishi11-Dec-01 7:49
Masaaki Onishi11-Dec-01 7:49 
QuestionIs there a round function? Pin
Chambers11-Dec-01 3:45
Chambers11-Dec-01 3:45 
AnswerRe: Is there a round function? Pin
#realJSOP11-Dec-01 4:06
mve#realJSOP11-Dec-01 4:06 
AnswerRe: Is there a round function? Pin
Alvaro Mendez11-Dec-01 4:09
Alvaro Mendez11-Dec-01 4:09 
GeneralRe: Is there a round function? Pin
Chambers11-Dec-01 4:13
Chambers11-Dec-01 4:13 
GeneralC++ operator Pin
Fred/M11-Dec-01 3:22
Fred/M11-Dec-01 3:22 
GeneralRe: C++ operator Pin
Ernest Laurentin11-Dec-01 4:08
Ernest Laurentin11-Dec-01 4:08 
GeneralRe: C++ operator Pin
Alvaro Mendez11-Dec-01 4:15
Alvaro Mendez11-Dec-01 4:15 
GeneralRe: C++ operator Pin
Fred/M11-Dec-01 4:42
Fred/M11-Dec-01 4:42 
GeneralRe: C++ operator Pin
Alvaro Mendez11-Dec-01 5:42
Alvaro Mendez11-Dec-01 5:42 
GeneralRe: C++ operator Pin
Jonathan Gilligan11-Dec-01 4:55
Jonathan Gilligan11-Dec-01 4:55 
GeneralRe: C++ operator Pin
Fred/M11-Dec-01 5:18
Fred/M11-Dec-01 5:18 
GeneralRe: C++ operator Pin
Michael Dunn11-Dec-01 8:00
sitebuilderMichael Dunn11-Dec-01 8:00 
GeneralUnicode/MBCS compatibility Pin
DataPrasad11-Dec-01 3:18
DataPrasad11-Dec-01 3:18 

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.