使用MFC.
(注意红色字体)AlphaBlend(*pdc, m_rtWork->left, m_rtWork->top, Width, High, cdcWork, 0, 0, Width, High, bf)
能显示图片
AlphaBlend(*pdc, m_rtWork->left, m_rtWork->top, Width, High, cdcWork, 0, 10, Width, High, bf)
不能显示。发现AlphaBlend返回FALSE。

解决方案 »

  1.   

    cdcWork.width =Width
    cdcWork.high =High
      

  2.   

    MSDN
    ----------------------------------------------------
    If the source rectangle and destination rectangle are not the same size, the source bitmap is stretched to match the destination rectangle. If the SetStretchBltMode function is used, the iStretchMode value is automatically converted to COLORONCOLOR for this function (that is, BLACKONWHITE, WHITEONBLACK, and HALFTONE are changed to COLORONCOLOR). The destination coordinates are transformed by using the transformation currently specified for the destination device context. The source coordinates are transformed by using the transformation currently specified for the source device context. An error occurs (and the function returns FALSE) if the source device context identifies an enhanced metafile device context. If destination and source bitmaps do not have the same color format, AlphaBlend converts the source bitmap to match the destination bitmap. AlphaBlend does not support mirroring. If either the width or height of the source or destination is negative, this call will fail. When rendering to a printer, first call GetDeviceCaps with SHADEBLENDCAPS to determine if the printer supports blending with AlphaBlend. Note that, for a display DC, all blending operations are supported and these flags represent whether the operations are accelerated.If the source and destination are the same surfacethat is, they are both the screen or the same memory bitmapand the source and destination rectangles overlap, an error occurs and the function returns FALSE. The source rectangle must lie completely within the source surface, otherwise an error occurs and the function returns FALSE.AlphaBlend fails if the width or height of the source or destination is negative.