|
김진섭 님이 쓰신 글 :
: GDI만을 사용해서 화면에 비트맵 하나를 출력하고자 합니다.
: 그런데 배경을 투명하게 처리해야 하는데,
: BitBlt만으로는 불가능한 것 같습니다.
: SetBkMode같은 함수는 문자열 출력에만 사용되는 것 같고...
: 그렇다고 일일이 한픽셀씩 찍어주는 건 너무 느려서 안되고...
:
: 비트맵을 복사할 때 투명색을 지정해 주면 그 색깔에 대해서는 투명하게 복사되는
: api함수는 없나요?
:
TransparentBlt함수를 사용하세요.
사용방법은 아래와 같습니다.
// wingdi.h
BOOL TransparentBlt(
HDC hdcDest, // handle to destination DC
int nXOriginDest, // x-coord of destination upper-left corner
int nYOriginDest, // y-coord of destination upper-left corner
int nWidthDest, // width of destination rectangle
int hHeightDest, // height of destination rectangle
HDC hdcSrc, // handle to source DC
int nXOriginSrc, // x-coord of source upper-left corner
int nYOriginSrc, // y-coord of source upper-left corner
int nWidthSrc, // width of source rectangle
int nHeightSrc, // height of source rectangle
UINT crTransparent // color to make transparent
);
|