Antonio Linares wrote:Me neither, but we will discover it
Dear Antonio,
Here is the source code that, maybe can help you. With it I can display 32bits bitmaps under windows XP.
Best regards,
Toninho.
---cut---
typedef int (_stdcall *ALPHABLEND) ( HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION);
static ALPHABLEND pAlphaBlend = NULL;
void DrawAlphaBlend( HDC hDC, HBITMAP hBitmap, int iCol, int iRow )
{
HDC hDcMem;
BITMAP bm;
HBITMAP hBmpOld;
RECT rct;
BLENDFUNCTION bf;
pAlphaBlend = ( ALPHABLEND ) GetProcAddress( LoadLibrary( "MSIMG32.DLL" ), "AlphaBlend" );
GetObject( ( HGDIOBJ ) hBitmap, sizeof( BITMAP ), ( LPSTR ) &bm );
hDcMem = CreateCompatibleDC( hDC );
hBmpOld = ( HBITMAP ) SelectObject( hDcMem, ( HGDIOBJ ) hBitmap );
bf.BlendOp = AC_SRC_OVER;
bf.BlendFlags = 0;
bf.SourceConstantAlpha = 255;
bf.AlphaFormat = AC_SRC_ALPHA;
pAlphaBlend( hDC, iRow, iCol, bm.bmWidth, bm.bmHeight, hDcMem, 0, 0, bm.bmWidth, bm.bmHeight, bf );
SelectObject( hDcMem, hBmpOld );
DeleteDC( hDcMem );
}
HB_FUNC( DRAWALPHA )
{
DrawAlphaBlend( ( HDC ) hb_parnl( 1 ), ( HBITMAP ) hb_parnl( 2 ), 0, 0 );
hb_retl( 1 );
}
---cut---