Click here to Skip to main content
15,892,072 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: maze in c Pin
LittleYellowBird2-Jun-10 0:18
LittleYellowBird2-Jun-10 0:18 
QuestionFILE* problem Pin
DevelopmentNoob1-Jun-10 19:12
DevelopmentNoob1-Jun-10 19:12 
AnswerRe: FILE* problem Pin
«_Superman_»1-Jun-10 19:50
professional«_Superman_»1-Jun-10 19:50 
AnswerRe: FILE* problem Pin
Aescleal1-Jun-10 20:28
Aescleal1-Jun-10 20:28 
AnswerRe: FILE* problem Pin
Jackson20102-Jun-10 5:08
Jackson20102-Jun-10 5:08 
QuestionBitBLT question Pin
ForNow1-Jun-10 17:28
ForNow1-Jun-10 17:28 
AnswerRe: BitBLT question Pin
«_Superman_»1-Jun-10 20:08
professional«_Superman_»1-Jun-10 20:08 
GeneralRe: BitBLT question Pin
ForNow2-Jun-10 1:29
ForNow2-Jun-10 1:29 
Hi,

I have the following code which paints a Gray Baxkground on a Bitmap consisting of a yellow around

and a while background

C#
    CBitmap *bm = new CBitmap;           // Bitmap Object

  bm->LoadBitmap((UINT) IDD_BITMAP);             // LOAD THE ARROW

      CDC *cdcimage = this->GetDC();

  cdcimage->SelectObject(bm);

       CDC cdcimage1, cdctrans;      // dcmask

      COLORREF oldback = cdcimage->SetBkColor(RGB(255,255,255));
  COLORREF oldtext = cdcimage->SetTextColor(RGB(0,0,0));

  cdcimage1.CreateCompatibleDC(cdcimage);
  cdctrans.CreateCompatibleDC(cdcimage);

  cdcimage1.SelectObject(bm);


 BITMAP bm_struct;

 bm->GetBitmap(&bm_struct);                              // get the demensions of ste arrow

 CBitmap bmask;                                     //  Create mask

      bmask.CreateBitmap(bm_struct.bmWidth,bm_struct.bmHeight,1,1,NULL);

      cdctrans.SelectObject(&bmask);

cdcimage1.SetBkColor(RGB(125,125,125));

cdctrans.BitBlt(0,0,bm_struct.bmWidth,bm_struct.bmHeight,&cdcimage1,0,0,SRCCOPY);

cdcimage->BitBlt(0,0,bm_struct.bmWidth,bm_struct.bmHeight,&cdcimage1,0,0,SRCINVERT);
cdcimage->BitBlt(0,0,bm_struct.bmWidth,bm_struct.bmHeight,&cdctrans,0,0,SRCAND);
cdcimage->BitBlt(0,0,bm_struct.bmWidth,bm_struct.bmHeight,&cdcimage1,0,0,SRCINVERT);

cdcimage->SetBkColor(oldback);
cdcimage->SetTextColor(oldtext);




later I pass the handle

C#
stgm.hBitmap = (HBITMAP)*bm;


to an OLE Richedit interface

However the bitmap remain as it on the file with a white background

any ideas

thankx
GeneralRe: BitBLT question I think I have to paint into a memry DC Pin
ForNow2-Jun-10 6:47
ForNow2-Jun-10 6:47 
QuestionC++ Socket Number - duration of socket number in server program Pin
simon alec smith1-Jun-10 12:01
simon alec smith1-Jun-10 12:01 
AnswerRe: C++ Socket Number - duration of socket number in server program Pin
Moak1-Jun-10 22:27
Moak1-Jun-10 22:27 
QuestionSynchronise Contacts with Exchange Server Mailboxes Pin
Steve Thresher1-Jun-10 8:03
Steve Thresher1-Jun-10 8:03 
Questionmouse related Q Pin
a.k.a BT1-Jun-10 7:19
a.k.a BT1-Jun-10 7:19 
AnswerRe: mouse related Q Pin
Richard MacCutchan1-Jun-10 7:59
mveRichard MacCutchan1-Jun-10 7:59 
GeneralRe: mouse related Q Pin
a.k.a BT1-Jun-10 8:17
a.k.a BT1-Jun-10 8:17 
GeneralRe: mouse related Q Pin
a.k.a BT1-Jun-10 8:59
a.k.a BT1-Jun-10 8:59 
GeneralRe: mouse related Q Pin
Richard MacCutchan1-Jun-10 21:23
mveRichard MacCutchan1-Jun-10 21:23 
AnswerRe: mouse related Q Pin
Software_Developer1-Jun-10 8:59
Software_Developer1-Jun-10 8:59 
GeneralRe: mouse related Q Pin
a.k.a BT1-Jun-10 9:09
a.k.a BT1-Jun-10 9:09 
AnswerRe: mouse related Q Pin
Stephen Hewitt1-Jun-10 16:56
Stephen Hewitt1-Jun-10 16:56 
QuestionProblem with Modeless dialogs Pin
Sreenivas0031-Jun-10 5:28
Sreenivas0031-Jun-10 5:28 
AnswerRe: Problem with Modeless dialogs Pin
Sarath C1-Jun-10 14:37
Sarath C1-Jun-10 14:37 
QuestionChild Window Pin
john56321-Jun-10 4:20
john56321-Jun-10 4:20 
AnswerRe: Child Window Pin
Niklas L1-Jun-10 5:16
Niklas L1-Jun-10 5:16 
AnswerRe: Child Window [modified] Pin
Software_Developer1-Jun-10 9:02
Software_Developer1-Jun-10 9:02 

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.