|
-
Sep 14th, 2000, 04:38 PM
#1
Thread Starter
Fanatic Member
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
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Sep 15th, 2000, 07:31 AM
#2
transcendental analytic
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
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Sep 15th, 2000, 03:12 PM
#3
Thread Starter
Fanatic Member
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
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
|