arifliminto86 0 Newbie Poster

Hi,

I got some difficulity how to move bitmap image in my application

basically, the algorithm is like this,

I've got CDC as m_MapDC and it already being created and DrawPoint basically use for draw truck in the mapDC but the result is there is no truck in the map
However, If I use CPen class instead of using CBitmap, I can see the line is moving from one point to other point. Any body have suggestions


void Ctrainc::DrawPoint()
{
CBitmap btruck;
CBitmap *pbtruck = NULL;

pbtruck = (CBitmap*)m_MapDC.selectObject(&btruck);

m_MapDC.MoveTo(m_PrevTruckPoint.m_iX,m_PrevTruckPoint.m_iY);
//move to the new pos
m_MapDC.LineTo(m_CurrTruckPoint.m_iX,m_CurrTruckPoint.m_iY);
m_MapDC.SelectObject(pOrbtruck);

btruck.DeleteObject();
}

Regards,

Arif Liminto