How to display a bitmap on the push button
-
I am using CBitmapButton to display bitmap on the push button. CBitmapButton m_bitmap; m_bitmap.Create(NULL, WS_CHILD|WS_VISIBLE|BS_OWNERDRAW, CRect(10,10,100,100), GetDc(), 1); m_bitmap.LoadBitmap(IDB_PLAY,0,0,0); This is not working S.Yamini
-
I am using CBitmapButton to display bitmap on the push button. CBitmapButton m_bitmap; m_bitmap.Create(NULL, WS_CHILD|WS_VISIBLE|BS_OWNERDRAW, CRect(10,10,100,100), GetDc(), 1); m_bitmap.LoadBitmap(IDB_PLAY,0,0,0); This is not working S.Yamini
If you are in VC++ try with create the CBitmapButton in your resource editor, set the Bitmap there, and then when you make click on the button set the property to visible as you want. If not... With your code you are creating the bitmap and loading in the button but, are u sure that your GetDC () is pointing where you need? Take a look step by step with the debugger
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
-
If you are in VC++ try with create the CBitmapButton in your resource editor, set the Bitmap there, and then when you make click on the button set the property to visible as you want. If not... With your code you are creating the bitmap and loading in the button but, are u sure that your GetDC () is pointing where you need? Take a look step by step with the debugger
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
thanks. It works now S.Yamini
-
thanks. It works now S.Yamini
-
I am using CBitmapButton to display bitmap on the push button. CBitmapButton m_bitmap; m_bitmap.Create(NULL, WS_CHILD|WS_VISIBLE|BS_OWNERDRAW, CRect(10,10,100,100), GetDc(), 1); m_bitmap.LoadBitmap(IDB_PLAY,0,0,0); This is not working S.Yamini
yaminisridaran wrote:
This is not working
See here for one that does.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne