다음을 통해 공유


CImage::TransparentBlt

비트맵 소스 장치 컨텍스트에서이 현재 장치 컨텍스트를 복사합니다.

BOOL TransparentBlt(
   HDC hDestDC,
   int xDest,
   int yDest,
   int nDestWidth,
   int nDestHeight,
   UINT crTransparent = CLR_INVALID 
) const throw( );
BOOL TransparentBlt(
   HDC hDestDC,
   const RECT& rectDest,
   UINT crTransparent = CLR_INVALID 
) const throw( );
BOOL TransparentBlt(
   HDC hDestDC,
   int xDest,
   int yDest,
   int nDestWidth,
   int nDestHeight,
   int xSrc,
   int ySrc,
   int nSrcWidth,
   int nSrcHeight,
   UINT crTransparent = CLR_INVALID 
) const throw( );
BOOL TransparentBlt(
   HDC hDestDC,
   const RECT& rectDest,
   const RECT& rectSrc,
   UINT crTransparent = CLR_INVALID 
) const throw( );

매개 변수

  • hDestDC
    대상 디바이스 컨텍스트의 핸들입니다.

  • xDest
    논리 단위로 대상 사각형의 왼쪽된 위 모서리의 x 좌표입니다.

  • yDest
    논리 단위로 대상 사각형의 왼쪽된 위 모서리의 y 좌표입니다.

  • nDestWidth
    논리 단위로 대상 사각형의 너비입니다.

  • nDestHeight
    논리 단위로 대상 사각형의 높이입니다.

  • crTransparent
    투명으로 처리 하는 소스 비트맵의 색입니다.기본적으로 CLR_INVALID, 현재 이미지의 투명 한 색으로 설정 색을 사용 해야 함을 나타내는.

  • rectDest
    참조 하는 RECT 구조, 대상 식별 합니다.

  • xSrc
    논리 단위, 소스 사각형의 왼쪽된 위 모서리의 x 좌표입니다.

  • ySrc
    논리 단위, 소스 사각형의 왼쪽된 위 모서리의 y 좌표입니다.

  • nSrcWidth
    논리 단위, 소스 사각형의 너비입니다.

  • nSrcHeight
    논리 단위, 소스 사각형의 높이입니다.

  • rectSrc
    참조는 RECT 구조, 소스를 식별 합니다.

반환 값

True 이면 면 그렇지 거짓.

설명

TransparentBlt4 비트 픽셀 당 8 비트 / 픽셀의 원본 비트맵 지원 됩니다.사용 CImage::AlphaBlend 32 비트-픽셀 별 비트맵 투명도를 지정 합니다.

이 메서드는 Microsoft Windows 2000, Windows 98 및 이후 시스템에 적용 됩니다.참조 지연 해야 에 있는 Windows SDK 및 CImage 제한 이전 운영 체제와 에 대 한 자세한.

예제

// Performs a transparent blit from the source image to the destination 
// image using the images' current transparency settings
BOOL TransparentBlt(CImage* pSrcImage, CImage* pDstImage, int xDest, int yDest,
   int nDestWidth, int nDestHeight)
{
   HDC hDstDC = NULL;
   BOOL bResult;

   if(pSrcImage == NULL || pDstImage == NULL)
   {
      // Invalid parameter
      return FALSE;
   }

   // Obtain a DC to the destination image
   hDstDC = pDstImage->GetDC();

   // Perform the blit
   bResult = pSrcImage->TransparentBlt(hDstDC, xDest, yDest, nDestWidth, nDestHeight);

   // Release the destination DC
   pDstImage->ReleaseDC();

   return bResult;
}

요구 사항

헤더: atlimage.h

참고 항목

참조

CImage 클래스

CImage::StretchBlt

CImage::MaskBlt

CImage::BitBlt