Click to See Complete Forum and Search --> : CBitmapButton and 24bits pictures


TeddyBeer
May 16th, 1999, 12:02 PM
hi,
i'm trying to construct dynamically a CBitmapButton and i have an assertion fault when i use a bitmap that is not 4bpp.
Is there a way to avoid that problem ?
If not, how to have transparency with 4bpp ?
Here is part of the code that crashes :
Signal.Boutton.Create(szState, BS_OWNERDRAW|WS_VISIBLE|WS_CHILD,
CRect(GetEnd().GetX()-10,
GetEnd().GetY()-20,
GetEnd().GetX(),
GetEnd().GetY()),
AfxGetMainWnd(),
WM_USER+GetNumber());
Signal.Boutton.LoadBitmaps(IDB_RED);

Pascal Van Caldenborgh
Telecom and Real-Time Analyst Programmer

Playman Cheng
May 17th, 1999, 07:47 AM
Why you use the owner-draw style when you creating the button,this is the fail cause,
remove it and try again,you will find it works.