|
-
February 12th, 2004, 11:46 AM
#1
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 ?
-
February 12th, 2004, 12:43 PM
#2
//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;
}
-
February 12th, 2004, 01:45 PM
#3
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
-
February 12th, 2004, 02:24 PM
#4
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).
Good luck
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|