-
Wince setbitmap
I have problem with showing bitmap in static picture control.
i cant debug it on wince - so i tested on winxp and just moved code.
i have static control pic - with default bitmap.
By clicking on button it should change to another one.
on initDlg
i do
CBitmap a=LoadBitmap(IDB_BITMAP1);
and in the button function onClick i do
m_pic.SetBitmap(a);
m_pic - is control variable for picture control created by ClassWizard
////////// in vc++6 its ok
when i compile this in Embedded Visual C++
it runs as i was told without showing bitmaps
Can anyone help me with this ?
-
//Ugly but works
CStatic m_stat; //With notify check in the resources of the static
UINT uibmp = IDB_BITMAP2;
CBitmap bmp;
void CBMPChangeDlg::OnClick()
{
bmp.DeleteObject();
bmp.LoadBitmap(uibmp);
m_stat.SetBitmap(bmp);
uibmp=(uibmp==IDB_BITMAP2)?IDB_BITMAP1:IDB_BITMAP2;
}
-
Hi,
After changing the bitmap it might be possible to run the function called UpdateData to update the dialogs controls with the new values stored within the variables?
I hope that this helps!
Best Regards,
Lea Hayes
-
If all previous answers did not help, try to remove your static picture control and draw the bitmaps directly on the window HDC. This way always works. Especialy on WinCE. If it's difficult for you, on this site you can find CDIBLiteSection class (WinCE section if I'm not mistaken).