|
-
Apr 23rd, 2000, 06:14 PM
#1
Thread Starter
Fanatic Member
Will someone PLEASE tell me how to use MaskBlt, because I
think it's what the game I'm planning to make is going to
use. I know the list of what you should put in, but the
return value is always 0 and nothing happens.
Should MaskBlt refer to the same picture for picture and mask?
What do I put in the hbmMask bit?
Will someone please help?
Well, I'll leave you to it.
Bye!
-
Apr 26th, 2000, 11:45 PM
#2
-
Apr 26th, 2000, 11:50 PM
#3
Lively Member
Well, it depends.
If the transparent area of your image is black (rgb 0 0 0), you only need two blits, the AND mask, then the XOR mask. However, if the transparent area of your image is any other color (which is often the case if you use an unused color to generate the mask), then you need three blits - the XOR mask, the AND mask, and the XOR mask again.
- Steve
Real programmers use COPY CON PROGRAM.EXE
-
Apr 26th, 2000, 11:52 PM
#4
PowerPoster
I see.
Well, I took white as transparent...
-
Apr 27th, 2000, 02:33 AM
#5
Lively Member
Err, it might be black. The point is, if you pick a color like RGB(255,0,255) (bright pink/purple), two Blits will leave the transparent area a bit...colored.
- Steve
Real programmers use COPY CON PROGRAM.EXE
-
Apr 30th, 2000, 02:56 AM
#6
Thread Starter
Fanatic Member
Ah, well. Next time I need to set a value to zero I'll use MaskBlt 
Thanks for the advice 
I'm just going to add another question:
I made a function MyBitBlt, which basically makes a sprite
The function goes like this:
Code:
Function MyBitBlt(Dst As PictureBox, Src As PictureBox, Mask As PictureBox, ByVal X As Long, ByVal Y As Long)
Call BitBlt(Dst.hDC, X, Y, Mask.ScaleWidth, Mask.ScaleHeight, Mask.hDC, _
0, 0, vbSrcAnd)
Call BitBlt(Dst.hDC, X, Y, Mask.ScaleWidth, Mask.ScaleHeight, Src.hDC, _
0, 0, vbSrcInvert)
End Function
So why is is soooo f************ slow?
Any advice form you VB pros?
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
|