fixed handling of dst offset in wxAlphaBlend()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36371 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-12-12 11:15:23 +00:00
parent f61b709751
commit 761598d4e5

View File

@@ -131,10 +131,13 @@ static bool AlphaBlt(HDC hdcDst,
const wxBitmap& bmpSrc); const wxBitmap& bmpSrc);
#ifdef wxHAVE_RAW_BITMAP #ifdef wxHAVE_RAW_BITMAP
// our (limited) AlphaBlend() replacement
// our (limited) AlphaBlend() replacement for Windows versions not providing it
static void static void
wxAlphaBlend(HDC hdcDst, int x, int y, int w, int h, int srcX, int srcY, const wxBitmap& bmp); wxAlphaBlend(HDC hdcDst, int x, int y, int w, int h,
#endif int srcX, int srcY, const wxBitmap& bmp);
#endif // wxHAVE_RAW_BITMAP
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// private classes // private classes
@@ -2562,14 +2565,16 @@ static bool AlphaBlt(HDC hdcDst,
#ifdef wxHAVE_RAW_BITMAP #ifdef wxHAVE_RAW_BITMAP
static void static void
wxAlphaBlend(HDC hdcDst, int xDst, int yDst, int w, int h, int srcX, int srcY, const wxBitmap& bmpSrc) wxAlphaBlend(HDC hdcDst, int xDst, int yDst,
int w, int h,
int srcX, int srcY, const wxBitmap& bmpSrc)
{ {
// get the destination DC pixels // get the destination DC pixels
wxBitmap bmpDst(w, h, 32 /* force creating RGBA DIB */); wxBitmap bmpDst(w, h, 32 /* force creating RGBA DIB */);
MemoryHDC hdcMem; MemoryHDC hdcMem;
SelectInHDC select(hdcMem, GetHbitmapOf(bmpDst)); SelectInHDC select(hdcMem, GetHbitmapOf(bmpDst));
if ( !::BitBlt(hdcMem, 0, 0, w, h, hdcDst, 0, 0, SRCCOPY) ) if ( !::BitBlt(hdcMem, 0, 0, w, h, hdcDst, xDst, yDst, SRCCOPY) )
{ {
wxLogLastError(_T("BitBlt")); wxLogLastError(_T("BitBlt"));
} }