I have started making a game in DirectX7 and VB.Net 2005 Express, and I was wondering how to make a surface display to the screen as being a certain amount of translucency. The code I used to make the surface is:
Sub LoadCDSurface() Dim ddsd As DDSURFACEDESC2
ddsd.lFlags = CONST_DDSURFACEDESCFLAGS.DDSD_CAPS
Or CONST_DDSURFACEDESCFLAGS.DDSD_HEIGHT Or CONST_DDSURFACEDESCFLAGS.DDSD_WIDTHddsd.ddsCaps.lCaps = CONST_DDSURFACECAPSFLAGS.DDSCAPS_OFFSCREENPLAIN
ddsd.lHeight = 32
ddsd.lWidth = 32
CDSurface = dd.CreateSurfaceFromFile(dataLocation &
"disk.bmp", ddsd) Dim key As DDCOLORKEYkey.high = RGB(0, 0, 0)
key.low = RGB(0, 0, 0)
CDSurface.SetColorKey(CONST_DDCKEYFLAGS.DDCKEY_SRCBLT, key)
End SubThe code I used to blt the surface to the screen is:
ddsB.BltFast(0, 568, CDSurface, CreateRect(0, 0, 32, 32), CONST_DDBLTFASTFLAGS.DDBLTFAST_WAIT
Or CONST_DDBLTFASTFLAGS.DDBLTFAST_SRCCOLORKEY)
What changes do I need to make to make it display as 50% transparent over the background

DirectDraw7 SemiTransparency?
polien
PKell
In answer to why I am using DirectX 7 - In DirectX9.0 DirectDraw has been combined with Direct3D, thus making it harder for a novice like me to use!
Anyway, I'll repost this on the Direct X forums.
Shawn.liang
Ozolayer
Did you consider posting this in the directx forums as your probably more likely to get a response there as it is really a directx issue.
The fact your writing code in VB is really rather irrelevent to the directx functionality which is language independent.
http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=106&SiteID=1
Also is there any reason you using directx7 and not the current version which I think is 9
GoatHunter
No problem with posting to here - its just those guys/girls are more likely to give you a straight out answer with there methods than you'll get in the VB general forum.
I'd still look to using latest versions of directx rather than earlier versions, it may take a bit more work to get to understand but learning on older versions often involves more headaches/heartaches when switching to a later version as functionality changes.