Hi, I have the following code extract:
In CView constructor:
m_Bitmap.CreateBitmap( 32, 32, 1, 16, NULL );
In OnDraw():
BITMAP BM;
m_Bitmap.GetObject( sizeof( BM ), &BM );
CPoint size( BM.bmWidth, BM.bmHeight );
pDC->DPtoLP( &size );
CPoint org( 0, 0 );
pDC->DPtoLP( &org );
CDC MemDC;
MemDC.CreateCompatibleDC( NULL );
CBitmap *POldBitmap = MemDC.SelectObject( &m_Bitmap );
MemDC.SetMapMode( pDC->GetMapMode() );
pDC->BitBlt( 0, 0, 32, 32, &MemDC, 0, 0, SRCCOPY );
MemDC.SelectObject( POldBitmap );
In OnTimer:
CClientDC ClientDC( this );
CDC MemDC;
CBitmap* pOldBitmap;
MemDC.CreateCompatibleDC( &ClientDC );
pOldBitmap = MemDC.SelectObject( &m_Bitmap );
MemDC.PatBlt( 0, 0, 32, 32, BLACKNESS );
MemDC.Ellipse( 2, 2, 30, 30 );
MemDC.MoveTo( 0, 0 );
MemDC.LineTo( 100, 500 );
However, nothing is drawn. The screen remains blank. I have no idea
where is thye problem. Can someone pls help? Thanks alot!