Can I use gif images for some toolbar buttons?
-
I use bitmaps for some toolbar buttons. Ex. In my .rc file I have:
FLDWZOOM BITMAP MOVEABLE PURE "fldwzoom.bmp"
I my .cpp file I load the bitmaps for the buttonscase IDM_ZOOM:hBitmap=LoadBitmap((HINSTANCEhResource, "FLDWZOOM"); break;
Can I load gif images instead of bitmaps? If I can, what function must I use?danginkgo
-
I use bitmaps for some toolbar buttons. Ex. In my .rc file I have:
FLDWZOOM BITMAP MOVEABLE PURE "fldwzoom.bmp"
I my .cpp file I load the bitmaps for the buttonscase IDM_ZOOM:hBitmap=LoadBitmap((HINSTANCEhResource, "FLDWZOOM"); break;
Can I load gif images instead of bitmaps? If I can, what function must I use?danginkgo
It's going to take some work. You can use OldLoadPicture to load a gif, which will give you an IPicture object. But you'll still need to show it on a button. The windows BUTTON class only takes HBITMAPs, so you'd need to do some owner draw. Luckily there's a whole bunch of owner-draw-buttons of all sorts here on codeproject. Look under desktop development / button controls. Even if you don't use one exactly (which would be a shock), you can still get good ideas on how to do your button. Good luck, Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
-
It's going to take some work. You can use OldLoadPicture to load a gif, which will give you an IPicture object. But you'll still need to show it on a button. The windows BUTTON class only takes HBITMAPs, so you'd need to do some owner draw. Luckily there's a whole bunch of owner-draw-buttons of all sorts here on codeproject. Look under desktop development / button controls. Even if you don't use one exactly (which would be a shock), you can still get good ideas on how to do your button. Good luck, Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
Thank you, but I still have a problem. I have the GIFs that I have to load for the buttons. The GIFs have transparent background. I must have transparent background images on my toolbar buttons. I can't obtain transparent background BMPs from those GIFs. I was hopping that I can use the GIFs. So, I can use only BMP and ICO for windows BUTTON class?
danginkgo
-
Thank you, but I still have a problem. I have the GIFs that I have to load for the buttons. The GIFs have transparent background. I must have transparent background images on my toolbar buttons. I can't obtain transparent background BMPs from those GIFs. I was hopping that I can use the GIFs. So, I can use only BMP and ICO for windows BUTTON class?
danginkgo
danginkgo wrote:
Thank you, but I still have a problem.
Luckily, I gave you a good answer - go have a proper read of the button section on codeproject. There you will find all sorts of owner-draw buttons. Using the normal button class without doing extra work? Tough.
danginkgo wrote:
So, I can use only BMP and ICO for windows BUTTON class?
Exactly. Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
-
danginkgo wrote:
Thank you, but I still have a problem.
Luckily, I gave you a good answer - go have a proper read of the button section on codeproject. There you will find all sorts of owner-draw buttons. Using the normal button class without doing extra work? Tough.
danginkgo wrote:
So, I can use only BMP and ICO for windows BUTTON class?
Exactly. Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
-
Thank you, but I still have a problem. I have the GIFs that I have to load for the buttons. The GIFs have transparent background. I must have transparent background images on my toolbar buttons. I can't obtain transparent background BMPs from those GIFs. I was hopping that I can use the GIFs. So, I can use only BMP and ICO for windows BUTTON class?
danginkgo
danginkgo wrote:
I have the GIFs that I have to load for the buttons. The GIFs have transparent background. I must have transparent background images on my toolbar buttons.
Just to follow up on what Iain said, here[^] is some sample code on
OleLoadPicture
.Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com
-
danginkgo wrote:
I have the GIFs that I have to load for the buttons. The GIFs have transparent background. I must have transparent background images on my toolbar buttons.
Just to follow up on what Iain said, here[^] is some sample code on
OleLoadPicture
.Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com