Click here to Skip to main content
15,889,867 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionserver emulator code help Pin
zeroKo31-May-10 15:31
zeroKo31-May-10 15:31 
AnswerRe: server emulator code help Pin
Stephen Hewitt31-May-10 16:07
Stephen Hewitt31-May-10 16:07 
GeneralRe: server emulator code help Pin
zeroKo31-May-10 17:04
zeroKo31-May-10 17:04 
GeneralRe: server emulator code help Pin
Stephen Hewitt31-May-10 20:21
Stephen Hewitt31-May-10 20:21 
GeneralRe: server emulator code help Pin
zeroKo31-May-10 23:56
zeroKo31-May-10 23:56 
GeneralRe: server emulator code help Pin
Stephen Hewitt1-Jun-10 13:55
Stephen Hewitt1-Jun-10 13:55 
GeneralRe: server emulator code help Pin
zeroKo1-Jun-10 14:12
zeroKo1-Jun-10 14:12 
QuestionBackground Color for Bitmap In Crichedtctrl Pin
ForNow31-May-10 8:57
ForNow31-May-10 8:57 
Hi,

I have a Arrow bitmap which has a White background and a Yellow Arrow

The BackGround of My Rich Edit is Gray RGB(125,125,125)

I would like the background of the Yellow Arrow to Match the background of My CRichEdit

I looked at some code from article on The CodeProject By Raja Segar entitled

"Drawing TransParent Bitmaps with ease"

and it seemed to do something close to what I want

I figured I didn't have to make the code that generic rather

I could Load the Bitmap and then create a mask bitmap with a text of white and background of Gray "OR" Orignal Bitmap and get what I went

Aprarently not

below is part of the Code

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

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

    CDC dcmask;                                              // dcmask

    dcmask.CreateCompatibleDC(NULL);                       // Create a generic DC

    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,bm_struct.bmPlanes,bm_struct.bmBitsPixel,NULL);

   dcmask.SelectObject(&bmask);                       // Select the bit map in

   dcmask.SetTextColor(RGB(0,0,0));                 // ALL WHITE

   dcmask.SetBkColor(RGB(125,125,125));            // GRAY

   CDC dcarrow;

   dcarrow.CreateCompatibleDC(NULL);

   dcarrow.SelectObject(bm);

   dcarrow.BitBlt(0,0,bm_struct.bmWidth,bm_struct.bmHeight,&dcmask,0,0,SRCPAINT);  // or the bits

   dcmask.DeleteDC();

   dcarrow.DeleteDC();



Afterwards I used OleCreateStaticfromData using the bitmap handle to Display the bitmap

would anyone know why I didn't get a gray background for the yellow arrow

thankx
Questionhow to format numbers with dollar sign in a cell for a CListCtrl Pin
manchukuo31-May-10 8:04
manchukuo31-May-10 8:04 
AnswerRe: how to format numbers with dollar sign in a cell for a CListCtrl Pin
CPallini31-May-10 9:35
mveCPallini31-May-10 9:35 
GeneralRe: how to format numbers with dollar sign in a cell for a CListCtrl Pin
manchukuo31-May-10 11:13
manchukuo31-May-10 11:13 
GeneralRe: how to format numbers with dollar sign in a cell for a CListCtrl Pin
CPallini31-May-10 21:36
mveCPallini31-May-10 21:36 
QuestionRe: how to format numbers with dollar sign in a cell for a CListCtrl Pin
David Crow1-Jun-10 5:08
David Crow1-Jun-10 5:08 
AnswerRe: how to format numbers with dollar sign in a cell for a CListCtrl Pin
PJ Arends1-Jun-10 5:52
professionalPJ Arends1-Jun-10 5:52 
Question.:: How to convert a gotten int input into a char or string which each of their elements can be accessable separately? [C++] Pin
bijan.8k31-May-10 7:29
bijan.8k31-May-10 7:29 
AnswerRe: .:: How to convert a gotten int input into a char or string which each of their elements can be accessable separately? [C++] Pin
Luc Pattyn31-May-10 7:35
sitebuilderLuc Pattyn31-May-10 7:35 
AnswerRe: Try this code Pin
Software_Developer31-May-10 8:28
Software_Developer31-May-10 8:28 
GeneralRe: Try this code Pin
bijan.8k31-May-10 9:02
bijan.8k31-May-10 9:02 
GeneralRe: Try this code Pin
Software_Developer31-May-10 9:52
Software_Developer31-May-10 9:52 
GeneralRe: Now it is just clunky Pin
Software_Developer31-May-10 17:38
Software_Developer31-May-10 17:38 
GeneralRe: Now it is just clunky Pin
Luc Pattyn31-May-10 18:27
sitebuilderLuc Pattyn31-May-10 18:27 
AnswerRe: .:: How to convert a gotten int input into a char or string which each of their elements can be accessable separately? [C++] Pin
Aescleal31-May-10 10:29
Aescleal31-May-10 10:29 
QuestionRe: .:: How to convert a gotten int input into a char or string which each of their elements can be accessable separately? [C++] Pin
David Crow1-Jun-10 5:13
David Crow1-Jun-10 5:13 
QuestionBest way to open a HTML file from an URL Pin
Joschwenk66631-May-10 6:34
Joschwenk66631-May-10 6:34 
QuestionRe: Best way to open a HTML file from an URL Pin
David Crow31-May-10 7:13
David Crow31-May-10 7:13 

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.