void CMyDLLImpl::draw(HWND hwnd, RECT & rc)
{
m_hWnd = hwnd;
//m_rc = &rc;
PAINTSTRUCT ps;
HDC hDC,hCDC; hDC = BeginPaint(hwnd,&ps);
hCDC = CreateCompatibleDC(hDC);
m_repanitRc.bottom = rc.bottom;
m_repanitRc.top = rc.top;
m_repanitRc.left = rc.left;
m_repanitRc.right = rc.right;
m_hBitmap =LoadBitmap(GetModuleHandle("MyDll.dll"),
MAKEINTRESOURCE(IDB_BITMAP2)); HBRUSH brush = CreateHatchBrush(HS_DIAGCROSS,RGB(0,0,0));
SetClassLong(m_hWnd,GCL_HBRBACKGROUND,(LONG)brush);
FillRect(hCDC,&rc,brush); SelectObject(hCDC,m_hBitmap);
//ExcludeClipRect(hDC,m_rc.left,m_rc.top,m_rc.right,m_rc.bottom); BitBlt(hDC,0,0,rc.right,rc.bottom,
hCDC,m_rc.left,m_rc.top,SRCCOPY); DeleteDC(hCDC);
EndPaint(hwnd,&ps);
::InvalidateRect(hwnd,&rc,FALSE);};void CMyDLLImpl::on_btn_up_pressed()
{
m_rc.bottom += 5;
m_rc.top += 5;
::InvalidateRect(m_hWnd,&m_repanitRc,TRUE);
}
有什么办法解决吗?
{
m_hWnd = hwnd;
//m_rc = &rc;
PAINTSTRUCT ps;
HDC hDC,hCDC; hDC = BeginPaint(hwnd,&ps);
hCDC = CreateCompatibleDC(hDC);
m_repanitRc.bottom = rc.bottom;
m_repanitRc.top = rc.top;
m_repanitRc.left = rc.left;
m_repanitRc.right = rc.right;
m_hBitmap =LoadBitmap(GetModuleHandle("MyDll.dll"),
MAKEINTRESOURCE(IDB_BITMAP2)); HBRUSH brush = CreateHatchBrush(HS_DIAGCROSS,RGB(0,0,0));
SetClassLong(m_hWnd,GCL_HBRBACKGROUND,(LONG)brush);
FillRect(hCDC,&rc,brush); SelectObject(hCDC,m_hBitmap);
//ExcludeClipRect(hDC,m_rc.left,m_rc.top,m_rc.right,m_rc.bottom); BitBlt(hDC,0,0,rc.right,rc.bottom,
hCDC,m_rc.left,m_rc.top,SRCCOPY); DeleteDC(hCDC);
EndPaint(hwnd,&ps);
::InvalidateRect(hwnd,&rc,FALSE);};void CMyDLLImpl::on_btn_up_pressed()
{
m_rc.bottom += 5;
m_rc.top += 5;
::InvalidateRect(m_hWnd,&m_repanitRc,TRUE);
}
有什么办法解决吗?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货