Button with Bitmap Image
-
Hi everyone. I know this is a bit of a beginner question, but I never had to do this task before and am a bit confused as the best way to do it. I have a button on a dialog, which I want to place a bitmap on (specifically, the little printer bitmap under the graphics/bitmaps directory of VC++). I can either make a CButton object, and do it this way, or use CBitmapButton. I want the button to work like a toolbar button (that is, in the way it looks, and the fact only 1 bitmap is used for all button states, not the up to 4 that CBitmapButton uses). I was going to use a CButton and place a bitmap on it, but I couldn't figure out how to get my bitmap (which is in the resource file as IDC_BMP_BITMAP) into an HBITMAP parameter, which CButton requires. I tried using CBitmap to get a HBITMAP handle back, but I couldn't quite figure out how to do this. I am sure this is a simple procedure, but it has me stumped tonight :rolleyes: Thanks in advance for any help!
-
Hi everyone. I know this is a bit of a beginner question, but I never had to do this task before and am a bit confused as the best way to do it. I have a button on a dialog, which I want to place a bitmap on (specifically, the little printer bitmap under the graphics/bitmaps directory of VC++). I can either make a CButton object, and do it this way, or use CBitmapButton. I want the button to work like a toolbar button (that is, in the way it looks, and the fact only 1 bitmap is used for all button states, not the up to 4 that CBitmapButton uses). I was going to use a CButton and place a bitmap on it, but I couldn't figure out how to get my bitmap (which is in the resource file as IDC_BMP_BITMAP) into an HBITMAP parameter, which CButton requires. I tried using CBitmap to get a HBITMAP handle back, but I couldn't quite figure out how to do this. I am sure this is a simple procedure, but it has me stumped tonight :rolleyes: Thanks in advance for any help!
Have a look at the fantastic CButtonST http://www.codeproject.com/buttonctrl/cbuttonst.asp Michael :-) Communication is the first step towards enlightenment.
-
Hi everyone. I know this is a bit of a beginner question, but I never had to do this task before and am a bit confused as the best way to do it. I have a button on a dialog, which I want to place a bitmap on (specifically, the little printer bitmap under the graphics/bitmaps directory of VC++). I can either make a CButton object, and do it this way, or use CBitmapButton. I want the button to work like a toolbar button (that is, in the way it looks, and the fact only 1 bitmap is used for all button states, not the up to 4 that CBitmapButton uses). I was going to use a CButton and place a bitmap on it, but I couldn't figure out how to get my bitmap (which is in the resource file as IDC_BMP_BITMAP) into an HBITMAP parameter, which CButton requires. I tried using CBitmap to get a HBITMAP handle back, but I couldn't quite figure out how to do this. I am sure this is a simple procedure, but it has me stumped tonight :rolleyes: Thanks in advance for any help!
I used a class very very useful : CxSkinButton If you want to have button of every shape and bitmap, try this link and I think you'll be surprised...;) http://www.codeproject.com/buttonctrl/CxSkinButton.asp Maybe you could tell me something too ?... Actually I'm trying to display more than one bmp at the same location but it doesn't work properly... I use the SetWindowPos function to place the bitmap and stretch it (or shrink it) to the correct size. It works well for the position and the size but not for the Z-Order (the first is over the second and I want the contrary). Setting the first parameter of the SetWindowPos to '&wndTop' does not change anything. If you could help me... Should computing stay as a source of benefit or become like knowledge : free and opened to every one ?...