-
May 3rd, 2002, 10:17 AM
#1
Transparent bmps in buttons
Hey
I'm trying to put 2 buttons in a dialog of mine, one having the small disk meaning save, and the other the small printer, which means, of course, print.
My first aproach was to see if these were OEM resources. They aren't as far as i know.
After that i created 2 resources in my project (one for each bmp), and then using CButton::SetBitmap(), I attached them to the buttons. The problem is that the bmps are not transparent, or in other words, if a user changes the colour scheme in windows, an ugly grey square will be visible in my buttons.
Is there any way to make these bmps transparent or solving my problem in any other way ?
Thanks in advance
__________________________________________________________
You can contact me at esanto@yahoo.com
-
May 3rd, 2002, 10:19 AM
#2
Re: Transparent bmps in buttons
I did this using owner drawn buttons. Another option is to create icons from the bitmaps and use these but you don't get text on the button as well as the icon.
Hope this helps
Hope this helps
-
May 3rd, 2002, 10:22 AM
#3
Re: Transparent bmps in buttons
I don't need to put text, so i think i'll use icons.
Do you know any good program to create icons, given a bmp ?
__________________________________________________________
You can contact me at esanto@yahoo.com
-
May 3rd, 2002, 11:30 AM
#4
Re: Transparent bmps in buttons
You can use an image list to create icons from bitmaps by the following method
HIMAGELIST hIml = ImageList_LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_YOURBITMAP), 16, 1, RGB(128, 128, 128));
// Where the rgb is the colour you wish to be transparent.
// 16 is the size and 1 is the number of images to grow by
HICON hIcon = ImageList_GetIcon(hIml, 0, ILD_NORMAL);
Hope this helps
Hope this helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|