|
-
Feb 18th, 2001, 08:25 PM
#1
Thread Starter
Addicted Member
Code:
Dim key As DDCOLORKEY
key.high = 0 'this is black
key.low = 0 'this is black
Sprite.SetColorKey DDCKEY_SRCBLT, key
The problem is i want to make the transparent color something other than black. I've tried giving it the value using RGB() but it didn't work. I tried a some others like DXRGB or something and it didn't work either. If any one knows how to do this I'd sure appreciate the help.
drewski
I see said the blind man as he spat into the wind.
It all comes back to me now!
A.D.T.'s VB
-
Feb 20th, 2001, 12:05 AM
#2
Thread Starter
Addicted Member
Hey!
can i get some feed back here people?
I see said the blind man as he spat into the wind.
It all comes back to me now!
A.D.T.'s VB
-
Feb 20th, 2001, 01:08 AM
#3
Fanatic Member
I'm not really sure if this will work but it is worth a try anyway, I can't test because I don't have DX on my CPU anymore but please let me know if it works or not, it sounds like you need to get the hiword and loword of the long color value.....
Code:
Private Sub Form_Load()
Dim c As Long
Dim hi As Integer, lo As Integer
Dim Key as DDCOLORKEY
c = RGB(255, 125, 63) ' define some weird color
hi = HiWord(c)
lo = LoWord(c)
Key.high = hi
Key.low = lo
Sprite.SetColorKey DDCKEY_SRCBLT, key
End Sub
Public Function HiWord(wParam As Long) As Integer
If wParam And &H80000000 Then
HiWord = (wParam \ 65535) - 1
Else
HiWord = wParam \ 65535
End If
End Function
Public Function LoWord(wParam As Long) As Integer
If wParam And &H8000& Then
LoWord = &H8000 Or (wParam And &H7FFF&)
Else
LoWord = wParam And &HFFFF&
End If
End Function
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Feb 20th, 2001, 09:08 PM
#4
Thread Starter
Addicted Member
thanks man
ill check it out
by the way i reuse 100% of my 'software'
I see said the blind man as he spat into the wind.
It all comes back to me now!
A.D.T.'s VB
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
|