General information
Category:
Microsoft Foundation Classes
Title:
Changing the bitmap
Hello people, i try to dev an aplication for change the bitmap (in this case for reflex an status: on or off)
i have 2 bitmaps . and depend of state i change the bitmap
i use the follow code:
// init the ports
for (int i = 0; i < 4; i++)
{
if (m_Ports[i].InitPort(this, i + 1, i == 0 ? 9600 : 19200))
{
m_Ports[i].StartMonitoring();
VERIFY(m_bmp.LoadBitmap(IDB_LGBRIGHT));
m_led1.SetBitmap(m_bmp);
}
else
{
// port not found
VERIFY(m_bmp.LoadBitmap(IDB_LGDIM));
m_led1.SetBitmap(m_bmp);
/*m_Edit[i].SetWindowText("NOT FOUND");
m_Edit[i].EnableWindow(FALSE);
m_ListBox[i].EnableWindow(FALSE);*/
}
/*switch(i)
{
case 0:
{this->m_led1.SetBitmap(m_bmp);break;}
case 1:
{m_led2.SetBitmap(m_bmp);break;}
case 2:
{m_led3.SetBitmap(m_bmp);break;}
case 3:
{m_led4.SetBitmap(m_bmp);break;}
}*/
m_bmp.DeleteObject();
}
i put m_led1 for test, and dont work. the m_led1 is a cstatic variable link to the bitmap object.
and the m_bmp is a variable type CBitmap
thanks for any help
Regards
Francisco Morosini
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only