Epo
02-25-2002, 02:51 PM
Dim CKey As DDCOLORKEY
Private Sub DrawPic()
'Drawing a person
Dim PersonRect As RECT
PersonRect.Top = CTop
PersonRect.Left = CLeft
PersonRect.Bottom = CBottom
PersonRect.Right = CRight
CKey.low = vbBlack
CKey.high = vbBlack
Character.SetColorKey DDCKEY_SRCBLT, CKey
Call BackBuffer.BltFast(XLeft, YDown, Character, PersonRect, DDBLT_KEYSRC Or DDBLTFAST_WAIT)
'Flip it
Primary.Flip Nothing, DDFLIP_WAIT
End Sub
I'm trying to set the black color on my picture to be transparent, but if i use the code (specifically when i add "DDBLT_KEYSRC" to the Call Backbuffer.BltFast line) then not only does the black become transparent, but the entire surface does (the picture disappears)
Any comments, ideas, glad to hear :)
Thanks
Private Sub DrawPic()
'Drawing a person
Dim PersonRect As RECT
PersonRect.Top = CTop
PersonRect.Left = CLeft
PersonRect.Bottom = CBottom
PersonRect.Right = CRight
CKey.low = vbBlack
CKey.high = vbBlack
Character.SetColorKey DDCKEY_SRCBLT, CKey
Call BackBuffer.BltFast(XLeft, YDown, Character, PersonRect, DDBLT_KEYSRC Or DDBLTFAST_WAIT)
'Flip it
Primary.Flip Nothing, DDFLIP_WAIT
End Sub
I'm trying to set the black color on my picture to be transparent, but if i use the code (specifically when i add "DDBLT_KEYSRC" to the Call Backbuffer.BltFast line) then not only does the black become transparent, but the entire surface does (the picture disappears)
Any comments, ideas, glad to hear :)
Thanks