Is there a way to set a color on a bitmap to transparent without doing a BitBlt mask in WM_PAINT everytime, can you just bitblt it onto the dc transparent?
wm_paint...hmmm in GDI...no way you must make a mask if its a game...or (harder) manage to modify individual pixels in bitmap selected in a DC or better: =========== make a memory array, make pixel operations in it then transfer pixels in it to a bitmap, select bitmap to a memory DC an again blit that bitmap to screen DC on wm_paint....like a backbuffer in DirectX...
While I forget it's name, if you confine yourself to Win98 and up, MS actually added a transparent blit api function. Nope, no example code either. And I never tried it. Gee, not much help at all, am I? ;-)
In Win 98 and 2000 there is API called AlphaBlend for blitting transparent bitmaps.
TTom, it's TransparentBlt. don't you hate it when you're that close?
how do i use TransparentBlt?
Look on microsoft.com and type TransparentBlt in the little search box then press go, there are 3 Bitmap funtions that are new to the win98 os
Another thing just occured to me. There's a trechnique to get the GDI stuff to make the mask for you, works any version (even Windows 3) Basically, you create a 2 color (B&W) DC, and set the backcolor to the desired 'transparent' color. Then load the desired bitmap there. What you get is a bitmap mounted in the DC, with the 'transparent' color rendered as black, and any other colors rendered as white. This automatically makes the mask bitmap for you.
Assembling: transtest.asm revealer.asm(164) : error A2006: undefined symbol : TransparentBlt how do i fix this?
nevermind i already got it, you just have to add: includelib MSIMG32.LIB and include MSIMG32.inc