| |
|
|
Georg Teles | Un schnelle Möglichkeit, una monochrome / schwarz-weiße Maske de una Bildhandle a redactar - Ejemplo beigefügt
Descargar
Ver código fuente
DEF CreateBitmap(5)!"GDI32","CreateBitmap"
DEF CreateCompatibleDC(1)!"GDI32","CreateCompatibleDC"
DEF Seleccionar objeto(2)!"GDI32","SelectObject"
DEF SetBkColor(2)!"GDI32","SetBkColor"
DEF BitBlt(9)!"GDI32","BitBlt"
DEF DeleteDC(1)!"GDI32","DeleteDC"
Proc Mask
Parámetros hPic&, dx&, dy&, col&
Declarar Mask&, dcPic&, dcMask&
mask& = CreateBitmap(dx&, dy&, 1, 1, 0)' monochrome Mapa de bits erzeugen
dcPic& = CreateCompatibleDC(0)
dcMask& = CreateCompatibleDC(0)
Seleccionar objeto(dcPic&, hPic&)
Seleccionar objeto(dcMask&, Mask&)
SetBkColor(dcPic&, col&)' Farbe, el como Transparent behanldet voluntad se
BitBlt(dcMask&, 0, 0, dx&, dy&, dcPic&, 0, 0, $00CC0020)' $00CC0020 = SRCCOPY
Seleccionar objeto(dcMask&,Mask&)
DeleteDC(dcPic&)
DeleteDC(dcMask&)
Volver Mask&
ENDPROC
CLS RGB(100,100,100)
Declarar bmp24bit&, mask24&
Declarar bmp32bit&, mask32&
bmp24bit& = Crear("HPIC",-1,"icon24bit.bmp")
bmp32bit& = Crear("HPIC",-1,"icon32bit.bmp")
mask24& = Mask(bmp24bit&,%BmpX,%BmpY,RGB(255,0,0))' en 24 Bit Bitmaps kann cierto Farbe gewählt voluntad, el transparent ser se
mask32& = Mask(bmp32bit&,%BmpX,%BmpY,RGB(0,0,0))' en 32 Bit Bitmaps con Canal Alfa Es el transparente Farbe schwarz
DrawPic bmp24bit&,0,0;0
DrawPic mask24&,0,32;0
DrawPic bmp32bit&,32,0;0
DrawPic mask32&,32,32;0
WaitInput
DeleteObject bmp24bit&
DeleteObject bmp32bit&
DeleteObject mask24&
DeleteObject mask32&
|
|
|
| |
|
|