自定义了一个对话框程序,中间留出一显示视频的区域,可是区域太小,只能显示一部分视频,请教一下如何在有限的区域中将全部视频都显示出来.也就是显示的按比例缩小???

解决方案 »

  1.   

    StretchDIBits
    The StretchDIBits function copies the color data for a rectangle of pixels in a device-independent bitmap (DIB) to the specified destination rectangle. If the destination rectangle is larger than the source rectangle, this function stretches the rows and columns of color data to fit the destination rectangle. If the destination rectangle is smaller than the source rectangle, this function compresses the rows and columns by using the specified raster operation. int StretchDIBits(
      HDC hdc,                // handle to device context
      int XDest,              // x-coordinate of upper-left corner of dest. rectangle
      int YDest,              // y-coordinate of upper-left corner of dest. rectangle
      int nDestWidth,         // width of destination rectangle
      int nDestHeight,        // height of destination rectangle
      int XSrc,               // x-coordinate of upper-left corner of source rectangle
      int YSrc,               // y-coordinate of upper-left corner of source rectangle
      int nSrcWidth,          // width of source rectangle
      int nSrcHeight,         // height of source rectangle
      CONST VOID *lpBits,            // address of bitmap bits
      CONST BITMAPINFO *lpBitsInfo,  // address of bitmap data
      UINT iUsage,                   // usage flags
      DWORD dwRop                    // raster operation code
    );