
Transparent Owner Drawn Bitmap Button
Quote:
>I have an Owner Drawn Bitmap Button (Subclass of CBitmapButton) and I have a
>class that draws Transparent bitmaps (a subclass of CBitmap). However, the
>portion of the button that I would like to be transparent is not. It appears
>the rectangle of the button is filled with the background of the window.
Henri,
This isn't really an answer to your question, but the simple solution
might be to abandon CBitmapButton and use the BS_ICON style instead.
If you're only supporting WIn95/NT4, and you don't need totally
different graphics for each state of the button, then this is a much
easier option. You create your icon, give the button the BS_ICON style
(you can do it from the dialog editor if your button is on a dialog),
and at run-time you set the icon like this:
HWND hUp;
hUp = GetDlgItem( hDlg, IDC_UP );
/* Assign the icon for the up button */
HICON hU = LoadImage( g_hInstance, MAKEINTRESOURCE( IDI_UP ),
IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR );
SendMessage( hUp, BM_SETIMAGE, IMAGE_ICON,
(LPARAM) (DWORD) hU );
Dave
----
Address is altered to discourage junk mail.
Remove ".---" for the real address.