Click here to Skip to main content
15,893,486 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: fatal error C1900 Pin
David Crow7-Jun-10 4:14
David Crow7-Jun-10 4:14 
QuestionDoxygen is melting my face, need pointers Pin
Trevor Johansen6-Jun-10 8:24
Trevor Johansen6-Jun-10 8:24 
AnswerRe: Doxygen is melting my face, need pointers Pin
Aescleal6-Jun-10 8:29
Aescleal6-Jun-10 8:29 
GeneralRe: Doxygen is melting my face, need pointers Pin
Trevor Johansen6-Jun-10 8:46
Trevor Johansen6-Jun-10 8:46 
GeneralRe: Doxygen is melting my face, need pointers Pin
Aescleal6-Jun-10 11:01
Aescleal6-Jun-10 11:01 
AnswerRe: Doxygen is melting my face, need pointers Pin
Moak6-Jun-10 10:18
Moak6-Jun-10 10:18 
GeneralRe: Doxygen is melting my face, need pointers Pin
Trevor Johansen6-Jun-10 12:29
Trevor Johansen6-Jun-10 12:29 
QuestionBitblt Transparency question Pin
ForNow5-Jun-10 23:31
ForNow5-Jun-10 23:31 
Hi,

I have bitmap with a white background and a yellow arrow I would like to convert the background to gray

So I have the following code

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

bm->LoadBitmap((UINT) IDD_BITMAP);   // load the yellow arrow with white background

  CDC *cdcwindow = this->GetDC();        // get dc

  CDC cdcimage;

 cdcimage.CreateCompatibleDC(cdcwindow);     // create a memory bitmap

CBitmap *oldbit = cdcimage.SelectObject(bm);   // select the it in






   cdcimage1.CreateCompatibleDC(&cdcimage);      // create another memory bitmap
   cdcimage1.SelectObject(bm);                      // select the color bitmap

   cdctrans.CreateCompatible(&cdcimage);             //Create another memory DC

   CBitmap bmask;                                     //  Create mask

   bmask.CreateBitmap(bm_struct.bmWidth,bm_struct.bmHeight,1,1,NULL);   // create a mono bitmap
   cdctrans.SelectObject(&bmask);                                   // select it


    COLORREF clr = cdcimage1.GetPixel(0,0);                               // get the backgroundd color

     cdcimage1.SetBkColor(clr);                                           //    set it

      cdctrans.BitBlt(0,0,bm_struct.bmWidth,bm_struct.bmHeight,&cdcimage1,0,0,SRCCOPY);  // copy color to mono settting backgound bits to to the background
                                                                                             // which is white and the arrow to black

       cdcimage.SetBkColor(RGB(125,125,125));                                                // set gray background
   cdcimage.SetTextColor(RGB(255,255,0));                                                // set yellow foreground


       cdcimage.BitBlt(0,0,bm_struct.bmWidth,bm_struct.bmHeight,&cdctrans,0,0,SRCCOPY);     // this should change white background to gray
                                                                                                // and black arrow to yellow

       stgm.hBitmap = (HBITMAP)*bm;                                                             get bit map handle



later on when I use the bit map handle in "OLE" it sets the bitmap as all yellow
AnswerRe: Bitblt Transparency question Pin
Niklas L6-Jun-10 9:07
Niklas L6-Jun-10 9:07 
GeneralRe: Bitblt Transparency question Pin
ForNow6-Jun-10 10:33
ForNow6-Jun-10 10:33 
GeneralRe: Bitblt Transparency question Pin
Niklas L6-Jun-10 10:59
Niklas L6-Jun-10 10:59 
GeneralRe: Bitblt Transparency question Pin
ForNow6-Jun-10 11:20
ForNow6-Jun-10 11:20 
GeneralRe: Bitblt Transparency question Pin
ForNow6-Jun-10 11:30
ForNow6-Jun-10 11:30 
GeneralRe: Bitblt Transparency question Pin
Niklas L6-Jun-10 11:42
Niklas L6-Jun-10 11:42 
GeneralRe: Bitblt Transparency question Pin
ForNow6-Jun-10 11:48
ForNow6-Jun-10 11:48 
GeneralRe: Bitblt Transparency question Pin
ForNow6-Jun-10 17:42
ForNow6-Jun-10 17:42 
GeneralRe: Bitblt Transparency question Pin
Niklas L6-Jun-10 20:48
Niklas L6-Jun-10 20:48 
GeneralRe: Bitblt Transparency question Pin
ForNow7-Jun-10 2:27
ForNow7-Jun-10 2:27 
QuestionAsynchronous sockets Pin
onyxbird5-Jun-10 19:06
onyxbird5-Jun-10 19:06 
AnswerRe: Asynchronous sockets Pin
Aescleal5-Jun-10 19:36
Aescleal5-Jun-10 19:36 
AnswerRe: Asynchronous sockets Pin
Moak6-Jun-10 8:06
Moak6-Jun-10 8:06 
GeneralRe: Asynchronous sockets Pin
onyxbird6-Jun-10 8:21
onyxbird6-Jun-10 8:21 
GeneralRe: Asynchronous sockets Pin
Moak6-Jun-10 10:13
Moak6-Jun-10 10:13 
GeneralRe: Asynchronous sockets Pin
onyxbird7-Jun-10 12:02
onyxbird7-Jun-10 12:02 
AnswerRe: Asynchronous sockets Pin
Mauro Leggieri6-Jun-10 9:11
Mauro Leggieri6-Jun-10 9:11 

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.