HBITMAP   hBitmap=LoadBitmap(g_hInst,MAKEINTRESOURCE(IDB_BITMAP1));   
HDC   hPaper=CreateCompatibleDC(hdc);   
  SelectObject(hPaper,hBitmap);   
  BitBlt(hdc,0,0,100,100,hPaper,0,0,SRCCOPY); 
是对的吗为什么里面有2个HDC 

解决方案 »

  1.   

    BitBlt
    The BitBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context. BOOL BitBlt(
      HDC hdcDest, // handle to destination DC
      int nXDest,  // x-coord of destination upper-left corner
      int nYDest,  // y-coord of destination upper-left corner
      int nWidth,  // width of destination rectangle
      int nHeight, // height of destination rectangle
      HDC hdcSrc,  // handle to source DC
      int nXSrc,   // x-coordinate of source upper-left corner
      int nYSrc,   // y-coordinate of source upper-left corner
      DWORD dwRop  // raster operation code
    );
    Parameters
    hdcDest 
    [in] Handle to the destination device context. 
    nXDest 
    [in] Specifies the logical x-coordinate of the upper-left corner of the destination rectangle. 
    nYDest 
    [in] Specifies the logical y-coordinate of the upper-left corner of the destination rectangle. 
    nWidth 
    [in] Specifies the logical width of the source and destination rectangles. 
    nHeight 
    [in] Specifies the logical height of the source and the destination rectangles. 
    hdcSrc 
    [in] Handle to the source device context. 
    nXSrc 
    [in] Specifies the logical x-coordinate of the upper-left corner of the source rectangle. 
    nYSrc 
    [in] Specifies the logical y-coordinate of the upper-left corner of the source rectangle. 
    dwRop 
    [in] Specifies a raster-operation code. These codes define how the color data for the source rectangle is to be combined with the color data for the destination rectangle to achieve the final color. 
    The following list shows some common raster operation codes. 
    MSDN 一目了然