[Win CE/Pocket PC]How to load an gif image on to a Button
-
Hi All, I am developing an application to Windows Mobile Using VS 2005. And the OS is Windows XP. I have developed a new dialpad with buttons. As a dialpad it works fine. But for this I need to load an image. Using CBitmapButton i can load only BMP images. This image changes according to the Skin of the mobile. When I googled I got the Answer as
SetBitmap
API. But to my badluck that is not available for CButton. Along with this, is it possible to write text on a loaded image? So can someone help regarding this. If it is Code then it will be more helpful. Thanks in advance.
-
Hi All, I am developing an application to Windows Mobile Using VS 2005. And the OS is Windows XP. I have developed a new dialpad with buttons. As a dialpad it works fine. But for this I need to load an image. Using CBitmapButton i can load only BMP images. This image changes according to the Skin of the mobile. When I googled I got the Answer as
SetBitmap
API. But to my badluck that is not available for CButton. Along with this, is it possible to write text on a loaded image? So can someone help regarding this. If it is Code then it will be more helpful. Thanks in advance.
madyastha wrote:
When I googled I got the Answer as SetBitmap API. But to my badluck that is not available for CButton.
See here.
madyastha wrote:
Along with this, is it possible to write text on a loaded image? So can someone help regarding this.
Does this help?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
madyastha wrote:
When I googled I got the Answer as SetBitmap API. But to my badluck that is not available for CButton.
See here.
madyastha wrote:
Along with this, is it possible to write text on a loaded image? So can someone help regarding this.
Does this help?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
Hello Thanks for quick response. Before posting here I have tried SetBitmap() or SendMessage() Functions. In the link you mentioned it is once again telling the same. Use SetBitmap(). So this wont solves my problem Thanks.
I was simply responding to your "SetBitmap is not available for CButton" statement. Have you looked at the
CImage
class? It can handle other graphic formats in addition to BMP."Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
I was simply responding to your "SetBitmap is not available for CButton" statement. Have you looked at the
CImage
class? It can handle other graphic formats in addition to BMP."Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
Hi... Is this is correct way of using CImage & its functions? Because using this also I was not able to load image.
HBITMAP hBitmap = NULL;
hBitmap = SHLoadImageFile(TEXT("windows\\dlrbtn_up_land.gif")); //this returns a valid handle.CRect tr;
m_btnSeven.GetClientRect(&tr);//Button on which i have to load imageHDC hdc;
hdc = ::GetDC(m_hWnd);//gets HDC.CImage cImage;
cImage.Attach(hBitmap);//Attach the HBITMAP to CImage objectcImage.Draw(hdc,tr);//Draw the image
-
Hi... Is this is correct way of using CImage & its functions? Because using this also I was not able to load image.
HBITMAP hBitmap = NULL;
hBitmap = SHLoadImageFile(TEXT("windows\\dlrbtn_up_land.gif")); //this returns a valid handle.CRect tr;
m_btnSeven.GetClientRect(&tr);//Button on which i have to load imageHDC hdc;
hdc = ::GetDC(m_hWnd);//gets HDC.CImage cImage;
cImage.Attach(hBitmap);//Attach the HBITMAP to CImage objectcImage.Draw(hdc,tr);//Draw the image