Click here to Skip to main content
15,887,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Drawing a bitmap [modified] Pin
Chris Losinger7-Jun-06 1:13
professionalChris Losinger7-Jun-06 1:13 
Questionwhich function gets color setting of PC? Pin
includeh106-Jun-06 10:27
includeh106-Jun-06 10:27 
AnswerRe: which function gets color setting of PC? Pin
Ryan Binns6-Jun-06 18:25
Ryan Binns6-Jun-06 18:25 
QuestionSocket Connection Pin
SPowers6-Jun-06 8:43
SPowers6-Jun-06 8:43 
QuestionCreateDIBSection Pin
includeh106-Jun-06 8:36
includeh106-Jun-06 8:36 
AnswerRe: CreateDIBSection Pin
valikac6-Jun-06 9:20
valikac6-Jun-06 9:20 
GeneralRe: CreateDIBSection Pin
includeh106-Jun-06 9:30
includeh106-Jun-06 9:30 
AnswerRe: CreateDIBSection Pin
Chris Losinger6-Jun-06 9:53
professionalChris Losinger6-Jun-06 9:53 
includeh10 wrote:
how to get original BITMAPINFO and ppBits of the HDC?


DC's do not have those things.

you need to allocate and fill-in the BITMAPINFO object yourself. and the ppvBits parameter is an output parameter, that receives a pointer to the start of a buffer. after you call CreateDIBSection, you copy your DIB's pixels into the buffer where that pointer points:
<br />
void *ppvBits = NULL;<br />
hbm = CreateDIBSection(hDC,(LPBITMAPINFO)lpbi, DIB_RGB_COLORS, &ppvBits, NULL, 0);<br />
		<br />
// copy DIB pixels...<br />
if (ppvBits!=NULL)<br />
{<br />
    // lpDIBBits = start of DIB pixels (this comes after the DIB header and palette)<br />
    memcpy((BYTE *)ppvBits, (BYTE *)lpDIBBits, numberOfPixelBytes);<br />
}<br />



Cleek | Image Toolkits | Thumbnail maker

GeneralRe: CreateDIBSection Pin
includeh106-Jun-06 10:15
includeh106-Jun-06 10:15 
GeneralRe: CreateDIBSection Pin
Chris Losinger6-Jun-06 11:25
professionalChris Losinger6-Jun-06 11:25 
GeneralRe: CreateDIBSection Pin
includeh106-Jun-06 11:55
includeh106-Jun-06 11:55 
GeneralRe: CreateDIBSection Pin
Chris Losinger6-Jun-06 15:30
professionalChris Losinger6-Jun-06 15:30 
Questionquestion about HBITMAP Pin
includeh106-Jun-06 8:24
includeh106-Jun-06 8:24 
AnswerRe: question about HBITMAP Pin
Chris Losinger6-Jun-06 8:30
professionalChris Losinger6-Jun-06 8:30 
GeneralRe: question about HBITMAP Pin
includeh106-Jun-06 8:44
includeh106-Jun-06 8:44 
GeneralRe: question about HBITMAP Pin
Chris Losinger6-Jun-06 9:46
professionalChris Losinger6-Jun-06 9:46 
GeneralRe: question about HBITMAP Pin
includeh106-Jun-06 10:22
includeh106-Jun-06 10:22 
GeneralRe: question about HBITMAP Pin
Chris Losinger6-Jun-06 11:28
professionalChris Losinger6-Jun-06 11:28 
GeneralRe: question about HBITMAP Pin
includeh106-Jun-06 11:56
includeh106-Jun-06 11:56 
GeneralRe: question about HBITMAP Pin
Chris Losinger6-Jun-06 15:39
professionalChris Losinger6-Jun-06 15:39 
QuestionButtons Not Enabled On My DialogBar Pin
masnu6-Jun-06 6:35
masnu6-Jun-06 6:35 
AnswerRe: Buttons Not Enabled On My DialogBar Pin
FarPointer6-Jun-06 7:15
FarPointer6-Jun-06 7:15 
AnswerRe: Buttons Not Enabled On My DialogBar Pin
Michael Dunn6-Jun-06 8:41
sitebuilderMichael Dunn6-Jun-06 8:41 
QuestionEnexistent data Pin
hint_546-Jun-06 6:27
hint_546-Jun-06 6:27 
QuestionAdding a Form-View and Creating a Tab Control on the form view in a Single Document based VC++ program using MFC. Pin
Ashutosh Bagaria6-Jun-06 6:20
Ashutosh Bagaria6-Jun-06 6:20 

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.