ajai
unread,Mar 30, 2012, 11:07:19 AM3/30/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hello,
i am trying to draw a line on a bitmap loaded into memory. but that line
drawing
function fails if i am trying to draw aline using the DC to which that bitmap
image is loaded.
Code is as follows:
HGDIOBJ hPrevObj = 0;
HGDIOBJ hPrevObj1 = 0;
hDC = GetDC( g_hWnd );
hDCMem = ::CreateCompatibleDC( hDC );
dwError = ::GetLastError();
hBitmap = ::LoadBitmap( g_hInstance, MAKEINTRESOURCE( IDB_BITMAP1 ));
dwError = ::GetLastError();
hPrevObj = ::SelectObject( hDC, hBitmap );
dwError = ::GetLastError();
hPrevObj1 = ::SelectObject( hDC, g_hPen );
dwError = ::GetLastError();
BOOL bStat = MoveToEx( hDC, g_X, g_Y,&g_Point );
dwError = ::GetLastError();
bStat = ::LineTo( hDC, g_X, g_Y+1 );
dwError = ::GetLastError();
bStat = ::BitBlt( hDC, 0,0, 240,82,hDCMem, 0,0, SRCCOPY );
::SelectObject( hDCMem, hPrevObj1);
dwError = ::GetLastError();
::SelectObject( hDCMem, hPrevObj);
dwError = ::GetLastError();
can anyone please help