English
Source / code snippets

Bildhandle To mask bitblt

 

Georg
Teles
an speedy Possibility, a monochrome / Black-weiße mask a Bildhandle to create - example enclosed

Download

View source
DEF CreateBitmap(5)!"GDI32","CreateBitmap"
DEF CreateCompatibleDC(1)!"GDI32","CreateCompatibleDC"
DEF SelectObject(2)!"GDI32","SelectObject"
DEF SetBkColor(2)!"GDI32","SetBkColor"
DEF BitBlt(9)!"GDI32","BitBlt"
DEF DeleteDC(1)!"GDI32","DeleteDC"

Proc Mask

    Parameters hPic&, dx&, dy&, col&
    Declare Mask&, dcPic&, dcMask&
    mask& = CreateBitmap(dx&, dy&, 1, 1, 0)' monochrome Bitmap produce
    dcPic& = CreateCompatibleDC(0)
    dcMask& = CreateCompatibleDC(0)
    SelectObject(dcPic&, hPic&)
    SelectObject(dcMask&, Mask&)
    SetBkColor(dcPic&, col&)' colour, The as Transparent behanldet go should
    BitBlt(dcMask&, 0, 0, dx&, dy&, dcPic&, 0, 0, $00CC0020)' $00CC0020 = SRCCOPY
    SelectObject(dcMask&,Mask&)
    DeleteDC(dcPic&)
    DeleteDC(dcMask&)
    Return Mask&

ENDPROC

CLS RGB(100,100,100)
Declare bmp24bit&, mask24&
Declare bmp32bit&, mask32&
bmp24bit& = Create("HPIC",-1,"icon24bit.bmp")
bmp32bit& = Create("HPIC",-1,"icon32bit.bmp")
mask24& = Mask(bmp24bit&,%BmpX,%BmpY,RGB(255,0,0))' with 24 bit Bitmaps can defined colour chosen go, The transparent his should
mask32& = Mask(bmp32bit&,%BmpX,%BmpY,RGB(0,0,0))' with 32 bit Bitmaps with Alpha Channel is the transparente colour Black
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&

6 kB
Hochgeladen:02/21/16
Downloadcounter149
Download
 
XProfan X3
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

02/21/16  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.351 Views

Untitledvor 0 min.
Georg Teles08/29/24
Sven Bader11/23/23
Walter04/11/23
H.Brill02/10/22
More...

Themeninformationen

this Topic has 1 subscriber:

Georg Teles (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie