Results 1 to 4 of 4

Thread: SRCBLT in DX7 How do I change the color!

  1. #1

    Thread Starter
    Addicted Member drewski's Avatar
    Join Date
    Feb 2000
    Location
    WA
    Posts
    242

    Angry

    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

  2. #2

    Thread Starter
    Addicted Member drewski's Avatar
    Join Date
    Feb 2000
    Location
    WA
    Posts
    242

    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

  3. #3
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Bethel, North Carolina, USA
    Posts
    987
    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}

  4. #4

    Thread Starter
    Addicted Member drewski's Avatar
    Join Date
    Feb 2000
    Location
    WA
    Posts
    242

    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
  •  



Click Here to Expand Forum to Full Width