Refering to DirectX development.
Anyone figured out how to use the DDCOLORKEY type?? I need to make a certain colour (bright purple to be exact) transparent, but I don't know how to use the .high and .low values. Who's found out?
Printable View
Refering to DirectX development.
Anyone figured out how to use the DDCOLORKEY type?? I need to make a certain colour (bright purple to be exact) transparent, but I don't know how to use the .high and .low values. Who's found out?
Use This:
Code:Sub Whatever
Dim CKey As DDCOLORKEY
Dim Surface1 as DirectDrawSurface7
dim DescS1 as DDSURFACEDESC2
Dim Transparent as long
Transparent=rgb(255,0,255)
ckey.low=transparent
ckey.high=transparent
DFlash.lFlags = DDSD_CAPS Or DDSD_HEIGHT Or DDSD_WIDTH
DFlash.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN
DFlash.lWidth = 100
DFlash.lHeight = 100
Set Surface1 = DDraw.CreateSurfaceFromFile(App.Path & "\mybmp.bmp", DescS1)
Surface1.SetColorKey DDCKEY_SRCBLT, CKey
End Sub
That would only work if your project uses 24-bit color... (I'm unsure about that). Anyway, here's a function to convert RGB to DirectX-Color. ;)