图像采集到了先,在内存中,怎么显示出来呢?

解决方案 »

  1.   

    SetDIBitsToDevice 
    The SetDIBitsToDevice function sets the pixels in the specified rectangle on the device that is associated with the destination device context using color data from a DIB. Windows 98/Me, Windows 2000/XP: SetDIBitsToDevice has been extended to allow a JPEG or PNG image to be passed as the source image. int SetDIBitsToDevice( 
      HDC hdc,                // handle to DC 
      int XDest,              // x-coord of destination upper-left corner 
      int YDest,              // y-coord of destination upper-left corner 
      DWORD dwWidth,          // source rectangle width 
      DWORD dwHeight,          // source rectangle height 
      int XSrc,                // x-coord of source lower-left corner 
      int YSrc,                // y-coord of source lower-left corner 
      UINT uStartScan,        // first scan line in array 
      UINT cScanLines,        // number of scan lines 
      CONST VOID *lpvBits,    // array of DIB bits 
      CONST BITMAPINFO *lpbmi, // bitmap information 
      UINT fuColorUse          // RGB or palette indexes 
    ); 
    Parameters 
    hdc 
    [in] Handle to the device context. 
    XDest 
    [in] Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle. 
    YDest 
    [in] Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle. 
    dwWidth 
    [in] Specifies the width, in logical units, of the DIB. 
    dwHeight 
    [in] Specifies the height, in logical units, of the DIB. 
    XSrc 
    [in] Specifies the x-coordinate, in logical units, of the lower-left corner of the DIB. 
    YSrc 
    [in] Specifies the y-coordinate, in logical units, of the lower-left corner of the DIB. 
    uStartScan 
    [in] Specifies the starting scan line in the DIB. 
    cScanLines 
    [in] Specifies the number of DIB scan lines contained in the array pointed to by the lpvBits parameter. 
    lpvBits 
    [in] Pointer to DIB color data stored as an array of bytes. For more information, see the following Res section. 
    lpbmi 
    [in] Pointer to a BITMAPINFO structure that contains information about the DIB. 
    fuColorUse 
    [in] Specifies whether the bmiColors member of the BITMAPINFO structure contains explicit red, green, blue (RGB) values or indexes into a palette. For more information, see the following Res section. 
    The fuColorUse parameter must be one of the following values. Value Meaning 
    DIB_PAL_COLORS The color table consists of an array of 16-bit indexes into the currently selected logical palette. 
    DIB_RGB_COLORS The color table contains literal RGB values. 
    Return Values 
    If the function succeeds, the return value is the number of scan lines set. If the function fails, the return value is zero. Windows NT/2000/XP: To get extended error information, call GetLastError.