BOOL TransparentBlt( HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int hHeightDest, HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, UINT crTransparent );
Parameters hdcDest Handle to the destination device context. nXOriginDest Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle. nYOriginDest Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle. nWidthDest Specifies the width, in logical units, of the destination rectangle. hHeightDest Handle to the height, in logical units, of the destination rectangle. hdcSrc Handle to the source device context. nXOriginSrc Specifies the x-coordinate, in logical units, of the source rectangle. nYOriginSrc Specifies the y-coordinate, in logical units, of the source rectangle. nWidthSrc Specifies the width, in logical units, of the source rectangle. nHeightSrc Specifies the height, in logical units, of the source rectangle. crTransparent The RGB color in the source bitmap to treat as transparent. Return Values If the function succeeds, the return value is TRUE.If the function fails, the return value is FALSE. ///////////////////////////////////////////////AlphaBlend( HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int hHeightDest, HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, BLENDFUNCTION blendFunction );
Parameter hdcDest Handle to the destination device context. nXOriginDest Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle. nYOriginDest Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle. nWidthDest Specifies the width, in logical units, of the destination rectangle. hHeightDset Handle to the height, in logical units, of the destination rectangle. hdcSrc Handle to the source device context. nXOriginSrc Specifies the x-coordinate, in logical units, of the upper-left corner of the source rectangle. nYOriginSrc Specifies the y-coordinate, in logical units, of the upper-left corner of the source rectangle. nWidthSrc Specifies the width, in logical units, of the source rectangle. nHeightSrc Specifies the height, in logical units, of the source rectangle. blendFunction Specifies the alpha blending function for source and destination bitmaps, a global alpha value to be applied to the entire source bitmap, and format information for the source bitmap. The source and destination blend functions are currently limited to AC_SRC_OVER. See the BLENDFUNCTION and EMRALPHABLEND structures. /////////////////////////////////////// BOOL TransparentImage(HDC hdcDest, LONG DstX, LONG DstY, LONG DstCx, LONG DstCy, HANDLE hSrc, LONG SrcX, LONG SrcY, LONG SrcCx, LONG SrcCy, COLORREF TransparentColor );At a Glance Header file: Wingdi.h Component: mgblt2 Platforms: H/PC Windows CE versions: 2.0 and later Parameters hdcDest Handle to a device context. DstX Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle. DstY Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle. DstCx Specifies the width, in logical units, of the destination rectangle. DistCy Specifies the height, in logical units, of the destination rectangle. hSrc Specifies a source device context or a source bitmap. SrcX Specifies the x-coordinate, in logical units, of the upper-left corner of the source rectangle. SrcY Specifies the y-coordinate, in logical units, of the upper-left corner of the source rectangle. SrcCx Specifies the width, in logical units, of the source rectangle. SrcCy Specifies the height, in logical units, of the source rectangle. TransparentColor Indicates the color in the bitmap that will be rendered transparent. Return Values If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
能否把你的代码给我一份,谢先![email protected]
to All :
谢谢大家!
HDC hdcDest,
int nXOriginDest,
int nYOriginDest,
int nWidthDest,
int hHeightDest,
HDC hdcSrc,
int nXOriginSrc,
int nYOriginSrc,
int nWidthSrc,
int nHeightSrc,
UINT crTransparent
);
Parameters
hdcDest
Handle to the destination device context.
nXOriginDest
Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle.
nYOriginDest
Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle.
nWidthDest
Specifies the width, in logical units, of the destination rectangle.
hHeightDest
Handle to the height, in logical units, of the destination rectangle.
hdcSrc
Handle to the source device context.
nXOriginSrc
Specifies the x-coordinate, in logical units, of the source rectangle.
nYOriginSrc
Specifies the y-coordinate, in logical units, of the source rectangle.
nWidthSrc
Specifies the width, in logical units, of the source rectangle.
nHeightSrc
Specifies the height, in logical units, of the source rectangle.
crTransparent
The RGB color in the source bitmap to treat as transparent.
Return Values
If the function succeeds, the return value is TRUE.If the function fails, the return value is FALSE. ///////////////////////////////////////////////AlphaBlend(
HDC hdcDest,
int nXOriginDest,
int nYOriginDest,
int nWidthDest,
int hHeightDest,
HDC hdcSrc,
int nXOriginSrc,
int nYOriginSrc,
int nWidthSrc,
int nHeightSrc,
BLENDFUNCTION blendFunction
);
Parameter
hdcDest
Handle to the destination device context.
nXOriginDest
Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle.
nYOriginDest
Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle.
nWidthDest
Specifies the width, in logical units, of the destination rectangle.
hHeightDset
Handle to the height, in logical units, of the destination rectangle.
hdcSrc
Handle to the source device context.
nXOriginSrc
Specifies the x-coordinate, in logical units, of the upper-left corner of the source rectangle.
nYOriginSrc
Specifies the y-coordinate, in logical units, of the upper-left corner of the source rectangle.
nWidthSrc
Specifies the width, in logical units, of the source rectangle.
nHeightSrc
Specifies the height, in logical units, of the source rectangle.
blendFunction
Specifies the alpha blending function for source and destination bitmaps, a global alpha value to be applied to the entire source bitmap, and format information for the source bitmap. The source and destination blend functions are currently limited to AC_SRC_OVER. See the BLENDFUNCTION and EMRALPHABLEND structures. ///////////////////////////////////////
BOOL TransparentImage(HDC hdcDest, LONG DstX, LONG DstY, LONG DstCx, LONG DstCy, HANDLE hSrc, LONG SrcX, LONG SrcY, LONG SrcCx, LONG SrcCy, COLORREF TransparentColor );At a Glance
Header file: Wingdi.h
Component: mgblt2
Platforms: H/PC
Windows CE versions: 2.0 and later
Parameters
hdcDest
Handle to a device context.
DstX
Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle.
DstY
Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle.
DstCx
Specifies the width, in logical units, of the destination rectangle.
DistCy
Specifies the height, in logical units, of the destination rectangle.
hSrc
Specifies a source device context or a source bitmap.
SrcX
Specifies the x-coordinate, in logical units, of the upper-left corner of the source rectangle.
SrcY
Specifies the y-coordinate, in logical units, of the upper-left corner of the source rectangle.
SrcCx
Specifies the width, in logical units, of the source rectangle.
SrcCy
Specifies the height, in logical units, of the source rectangle.
TransparentColor
Indicates the color in the bitmap that will be rendered transparent.
Return Values
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
如果不是,可以将窗口背景保存为位图,每拖动一次,就将背景重画一次,速度完全够用。
有源码吗?给一份参考一下
http://www.csdn.net/dev/Visual%20c++/source%20code/
如果没有的话,我光盘里多的是.
给我你的E-mail就ok了.
[email protected]
有源码吗?给一份参考一下 [email protected]