by manuramos » Fri Nov 24, 2006 3:40 pm
El caso es que de esa forma saldría tranparente, yo quiero una coisa más traslucida.
Al final lo he solucionado con el siguiente código:
PRG de FW
-------------
DEFINE BITMAP oBmp NAME ...
*
hCDc := CreateCDC(hDc)
SelectObject(hCDC,oBmp:hBitmap)
StretchBmp(hDc,10,20,nNeoWidth,nNeoHeight,hCDC,0,0,hBmp:nWidth,hBmp:nHeight, raster)
DeleteDc(hCDc)
DLL32 FUNCTION StretchBmp( hdc AS LONG,x AS LONG,y AS LONG,nWidth AS LONG,nHeight AS LONG, ;
hSrcDC AS LONG,xSrc AS LONG,ySrc AS LONG,nSrcWidth AS LONG,nSrcHeight AS LONG,dwRop AS LONG ) AS LONG ;
PASCAL FROM "StretchBlt" LIB "gdi32.dll"
en C:
-----
CLIPPER StretchMBitmap( PARAMS ) // ( HDC hdc, HBITMAP hBmp, RECT aRect, WORD raster )
{
HDC hdc = ( HDC ) _parnl( 1 ) ;
HDC hDcTemp = CreateCompatibleDC( hdc ) ;
HBITMAP hOld = ( HBITMAP ) SelectObject( hDcTemp, ( HBITMAP ) _parnl( 2 ) ) ;
DWORD raster = IF( PCOUNT() == 4, _parnl( 4 ), 0 ) ;
RECT rct ;
BITMAP bmp ;
rct.top = _parnl( 3, 1 ) ;
rct.left = _parnl( 3, 2 ) ;
rct.bottom = _parnl( 3, 3 ) ;
rct.right = _parnl( 3, 4 ) ;
GetObject( ( HGDIOBJ ) _parnl( 2 ), sizeof( BITMAP ), ( LPSTR ) &bmp ) ;
StretchBlt( hdc, rct.top, rct.left, rct.right-rct.left+1, rct.bottom-rct.top+1, hDcTemp, 0, 0, bmp.bmWidth, bmp.bmHeight, raster ) ;
DeleteObject( SelectObject(hDcTemp, hOld) ) ;
DeleteDC(hDcTemp) ;
}
Sin embargo, es curioso que el código FW no funciona en XP (o al menos en el mio) pero el escrito en C si funciona.
Nos Gusta Programar