How can I fill a button

Hi.
How can I fill a group of buttons with 8x8 pixels sized bitmaps ? Id like also to reverse the bitmaps colors, on clicking (black-white/white-black).
Thank you.
[171 byte] By [mioram] at [2007-11-17 0:46:42]
# 1 Re: How can I fill a button
Hi,

Check out the CBitmapButton class and its AutoLoad function. If you need more help, let me know about it. All Luck.

If the answer REALLY helps and if you want to, you can Rate it.
Visit http://www.geocities.com/contactgirish/homepage.html for some VC++ Links & Notes.[b]All Luck,
V.Girish
VGirish at 2007-11-10 6:46:18 >
# 2 Re: How can I fill a button
Ive used SetBitmap rather than AutoLoad function:
arr[i].pBitmap->LoadBitmap(arr[i].ID);
arr[i].pButton->SetBitmap(*arr[i].pBitmap);
That's because Id like to use one bitmap for both the states of each button; but Ive not found a function that reverse the bitmap colors for each state (perhaps because it doesnt exist ?).Moreover Im not able to apply the CreatePatternBrush function to fill the buttons.
Could you help me ?
mioram at 2007-11-10 6:47:18 >
# 3 Re: How can I fill a button
Hi,

You will have to use 2 bitmaps for each state of the button. ( Thats as far as I know )

If the answer REALLY helps and if you want to, you can Rate it.
Visit http://www.geocities.com/contactgirish/homepage.html for some VC++ Links & Notes.[b]All Luck,
V.Girish
VGirish at 2007-11-10 6:48:16 >
# 4 Re: How can I fill a button
Hi,
if I use SetBitmap (CButton) rather then AutoLoad (CBitmapButton) I can use only one bitmap per the button (MSDN).
My bitmaps are 8x8 pixels sized so I have to create a brush with CreatePatternBrush, after the calling to LoadBitmap.
Finally, with SelectObject and FillRect I could fill my buttons.
I have tried to do this by myself but without success.
Can you help me ?
mioram at 2007-11-10 6:49:20 >
# 5 Re: How can I fill a button
goto maxcode.com:
in the sourcecodes->visual c++->controls category there are several examples on this topic!

http://www.maxcode.com/images/s2source.gifhttp://www.maxcode.com/images/s2tut.gifhttp://www.maxcode.com/images/s2doc.gifhttp://www.maxcode.com/images/s2com.gif
All At http://www.maxcode.com/
-----------
Clemens Timmermans (17-Year old)
------------
- 'The Matrix has you, NEO' -(quote from: the Matrix)
maxcode at 2007-11-10 6:50:19 >