Transparent Owner Drawn Bitmap Button 
Author Message
 Transparent Owner Drawn Bitmap Button

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.
Does anyone have any ideas on how to get around this?



Mon, 03 Jul 2000 03:00:00 GMT  
 Transparent Owner Drawn Bitmap Button

You need to draw the entire area of the button.  Nothing is being painted
for you.  Perhaps you should override OnEraseBkgnd() on your supclassed
button and Erase the background with the current button face color.

Hope this helps

Dan Stephens
www.SapphireOnline.com

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.
>Does anyone have any ideas on how to get around this?



Tue, 04 Jul 2000 03:00:00 GMT  
 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.



Tue, 04 Jul 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Owner draw & transparent text buttons

2. Button with Bitmap (Not Owner-draw)

3. Fly over on owner drawn or bitmap buttons

4. Owner draw buttons get extraneous draw item messages

5. MSVC 1.52 button disable with owner draw buttons

6. Owner draw button in replacement of the next/back button in a CPropertySheet in Wizard mode

7. Newbie to owner drawn: Scroll Bars in Owner drawn ListCtrl

8. How to draw transparent bitmap?

9. How to use BitBlt to draw a transparent bitmap

10. Drawing transparent bitmap - HELP !!!

11. How can I draw a transparent Bitmap?

12. how can i draw a transparent bitmap

 

 
Powered by phpBB® Forum Software