changed &memDC to memDC.GetSafeHdc();
then it will ok.

解决方案 »

  1.   

    改成这样之后,
    TransparentBlt(bitmap,50,50,rect.Width()-20,rect.Height()-20,MemDC.m_hDC,0,0,100,100,50);
    它又说
    E:\loppp\program\bmp1\bmp1Dlg.cpp(208) : error C2664: 'TransparentBlt' : cannot convert parameter 1 from 'struct HBITMAP__ *' to 'struct HDC__ *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    Error executing cl.exe.
      

  2.   

    HDC hdc=CreateCompatibleDC(NULL);SelectObject(bitmap);.........TransparentBlt(hdc,50,50,rect.Width()-20,rect.Height()-20,MemDC.m_hDC,0,0,100,100,50);