Click here to Skip to main content
15,900,725 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCDateTimeCtrl and CTime Pin
User 66584-Mar-02 2:59
User 66584-Mar-02 2:59 
GeneralRe: CDateTimeCtrl and CTime Pin
Prem Kumar4-Mar-02 3:11
Prem Kumar4-Mar-02 3:11 
GeneralRe: CDateTimeCtrl and CTime Pin
Tomasz Sowinski4-Mar-02 3:26
Tomasz Sowinski4-Mar-02 3:26 
GeneralRe: CDateTimeCtrl and CTime Pin
Prem Kumar4-Mar-02 3:28
Prem Kumar4-Mar-02 3:28 
GeneralRe: CDateTimeCtrl and CTime Pin
Tomasz Sowinski4-Mar-02 3:30
Tomasz Sowinski4-Mar-02 3:30 
GeneralRe: CDateTimeCtrl and CTime Pin
User 66584-Mar-02 3:43
User 66584-Mar-02 3:43 
Generalsocket backlog problem Pin
4-Mar-02 2:02
suss4-Mar-02 2:02 
GeneralRe: socket backlog problem Pin
Tim Smith4-Mar-02 2:14
Tim Smith4-Mar-02 2:14 
GeneralRe: socket backlog problem Pin
Joaquín M López Muñoz4-Mar-02 2:17
Joaquín M López Muñoz4-Mar-02 2:17 
GeneralCopy system registry files in win 2k Pin
4-Mar-02 1:35
suss4-Mar-02 1:35 
GeneralViewing flash files Pin
Jon Newman4-Mar-02 1:14
Jon Newman4-Mar-02 1:14 
GeneralRe: Viewing flash files Pin
benjymous4-Mar-02 2:57
benjymous4-Mar-02 2:57 
GeneralFindFirstFile & FindNextFile Pin
Mauricio Ritter4-Mar-02 1:08
Mauricio Ritter4-Mar-02 1:08 
GeneralRe: FindFirstFile & FindNextFile Pin
Tomasz Sowinski4-Mar-02 1:28
Tomasz Sowinski4-Mar-02 1:28 
GeneralRe: FindFirstFile & FindNextFile Pin
Mauricio Ritter4-Mar-02 1:42
Mauricio Ritter4-Mar-02 1:42 
GeneralContainer window for DLLs Pin
4-Mar-02 0:55
suss4-Mar-02 0:55 
GeneralRe: Container window for DLLs Pin
Tomasz Sowinski4-Mar-02 1:24
Tomasz Sowinski4-Mar-02 1:24 
GeneralRe: Container window for DLLs Pin
4-Mar-02 3:24
suss4-Mar-02 3:24 
GeneralRe: Container window for DLLs Pin
4-Mar-02 1:37
suss4-Mar-02 1:37 
QuestionSpecific device context ? Pin
Andrew Hoole4-Mar-02 0:27
Andrew Hoole4-Mar-02 0:27 
AnswerRe: Specific device context ? Pin
Tomasz Sowinski4-Mar-02 0:30
Tomasz Sowinski4-Mar-02 0:30 
GeneralRe: Specific device context ? Pin
Andrew Hoole4-Mar-02 2:12
Andrew Hoole4-Mar-02 2:12 
Seems a good idea. Now I have the following..

---------------------------------------------------------------------------
CDC dcMem;
dcMem.CreateCompatibleDC(NULL); // Needed otherwise handle is uninitialised

// Set up all the BITMAPINFO data
char pDIBHdr[sizeof(BITMAPINFOHEADER) + 256*sizeof(RGBQUAD)];
BITMAPINFOHEADER *pBitmapInfoHdr;
RGBQUAD *pRGB;

pBitmapInfoHdr = (BITMAPINFOHEADER *)pDIBHdr;

// Setup the header information for the device independent bitmap which
// is going to be used
pBitmapInfoHdr->biSize = sizeof(BITMAPINFOHEADER);
pBitmapInfoHdr->biWidth = 256;
pBitmapInfoHdr->biHeight = 256;
pBitmapInfoHdr->biPlanes = 1;
pBitmapInfoHdr->biBitCount = 8;
pBitmapInfoHdr->biCompression = 0;
pBitmapInfoHdr->biSizeImage = 0;
pBitmapInfoHdr->biClrUsed = 0;

pRGB = (RGBQUAD *)(pDIBHdr + pBitmapInfoHdr->biSize);
for(int ii=0;ii<256;ii++){
pRGB[ii].rgbRed = ii;
pRGB[ii].rgbGreen = ii;
pRGB[ii].rgbBlue = ii;
}


void* pTmpMem;
CreateDIBSection(dcMem.m_hDC,(BITMAPINFO *)pDIBHdr,DIB_RGB_COLORS,&pTmpMem,NULL,0);

dcMem.Rectangle(CRect(0,0,100,100));

pData = (short *)pTmpMem;

// Now use pData to access the actual data out of the bitmap

--------------------------------------------------------------

The output I now get doesn't reflect the Rectangle draw that I performed.
Should it ? Although I have created this DIB is it selected into the DC as the memory surface onto which the draw functions will be occurring. If not how does one achieve that, so that the draw functions accessed via the DC will write into this DIB.

Thanks

Andrew
GeneralRe: Specific device context ? Pin
Tomasz Sowinski4-Mar-02 2:17
Tomasz Sowinski4-Mar-02 2:17 
QuestionThrowing exception on thread end ? Pin
Alwin753-Mar-02 23:49
Alwin753-Mar-02 23:49 
AnswerRe: Throwing exception on thread end ? Pin
Tomasz Sowinski3-Mar-02 23:57
Tomasz Sowinski3-Mar-02 23:57 

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.