-
When using the DirectDraw Funciton SetColorKey how do i convert the RGB Value for the color i want into the DDCOLORKEY Structure. I have bright green as my key. I tried:
Code:
Key.high = RGB(0,255,0)
Key.low = RGB(0,255,0)
That didn't work, the only thing i know is black is
Code:
key.high = 0
key.low = 0
Can't do that because black is in my pict
Any help would be great
Grant
-
Just something i got from Fox page:
Code:
Function ConvertColor(R As Byte, G As Byte, B As Byte, Surface As DirectDrawSurface7) As Long
Dim Temp As DDPIXELFORMAT
Dim Red As Single
Dim Green As Single
Dim Blue As Single
Dim Alpha As Single
'Shift colors
Red = R / 255
Green = G / 255
Blue = B / 255
Alpha = 1
'Get the pixel format
Surface.GetPixelFormat Temp
'Return the scaled color
ConvertColor = (Temp.lRGBAlphaBitMask * Alpha And Temp.lRGBAlphaBitMask) + (Temp.lRBitMask * Red And Temp.lRBitMask) + (Temp.lGBitMask * Green And Temp.lGBitMask) + (Temp.lBBitMask * Blue And Temp.lBBitMask)
End Function
-