|
-
Apr 28th, 2002, 04:08 PM
#1
Thread Starter
Member
How To Mask A Color?
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..
XX The Signature of the Gods XX
-
Apr 28th, 2002, 04:44 PM
#2
New Member
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
-
Apr 28th, 2002, 04:45 PM
#3
New Member
i forgot to say that the ship figure has to be bitblt with the srcinvert option
-
Apr 28th, 2002, 05:09 PM
#4
Thread Starter
Member
Sweet, thnx! heeh first time i bitbltted the ship first, and nothing showed up.. but i got it :P
XX The Signature of the Gods XX
-
May 1st, 2002, 01:12 AM
#5
PowerPoster
No need to declare the blitting operators, they're all pre-defined in VB:
VB Code:
vbSrcPaint
vbSrcAnd
vbSrcCopy
aso.
-
May 1st, 2002, 10:05 PM
#6
Thread Starter
Member
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?
XX The Signature of the Gods XX
-
May 2nd, 2002, 04:42 AM
#7
PowerPoster
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.
-
May 2nd, 2002, 11:05 AM
#8
Fanatic Member
You can use a gray-based mask for partail transperancy. Ue vbSrcAnd for the mask, and vbSrcPaint for the sprite (ship).
-
May 2nd, 2002, 01:58 PM
#9
PowerPoster
Well you can't. The funtions give you something like transluency but it's not what you need I s'pose.
-
May 2nd, 2002, 02:35 PM
#10
Good Ol' Platypus
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.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
May 2nd, 2002, 09:15 PM
#11
Thread Starter
Member
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?
XX The Signature of the Gods XX
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|