well... I am using bitblt, how would I mask a color? Cause when the ships over lap in this simple little spaceship game it looks real funny..
Printable View
well... I am using bitblt, how would I mask a color? Cause when the ships over lap in this simple little spaceship game it looks real funny..
just bitblt a mask (white background, ship figure in all black) with the option (instead of srccopy) SrcAnd and then bitblt your figure (ship) with an all black background. consts for differents options: Public Const SRCAND = &H8800C6
Public Const SRCCOPY = &HCC0020
Public Const SRCINVERT = &H660046
It works best when you bitblt on a buffer .hdc first and then copy the hdc to screen.
I hope this can be of help to you
i forgot to say that the ship figure has to be bitblt with the srcinvert option
Sweet, thnx! heeh first time i bitbltted the ship first, and nothing showed up.. but i got it :P
No need to declare the blitting operators, they're all pre-defined in VB:
VB Code:
vbSrcPaint vbSrcAnd vbSrcCopy aso.
yeah, that' how i usually do it.
I got another question, I think is simple but I'm not sure; how do I make something partially transpearent?
What you can do using BitBlt is a 1-Bit-mask, meaning 100% or 0% visible (nothing between). Search the forums for Transparent blitting or look at the demos on my website ( http://fox.acky.net/vb/ ). If you need translucency I'd recommend you using DDraw because it's way faster. Again there are enough examples around so you might just want to search the forum for this one.
You can use a gray-based mask for partail transperancy. Ue vbSrcAnd for the mask, and vbSrcPaint for the sprite (ship).
Well you can't. The funtions give you something like transluency but it's not what you need I s'pose.
Two things I must point out:
The partial transparency (and it's only partial, it isn't accurate at all) only works with MergePaint/And combo (on many computers I've tested on), and vbMergePaint is the only one that works. The API's MergePaint is incorrect.
ok, i have no time to test that greyscale thing tonight, but i will, in the meantime, would you care to explain this mergepoint thing?