Transparant Bitmap in DX 9.0b 3D

Started by
1 comment, last by Thread 20 years ago
Hello, I want to display a 32bits bitmap with ColourKey (green RGB 128,255,0 transparent on Fullscreen. DirectX 9.0 SDK 3D surface. Loading the texture also with colourkey D3DCOLOR_XRGB(128,255,0). rslt=D3DXCreateTextureFromFileEx(g_pDevice,strPath, D3DX_DEFAULT, D3DX_DEFAULT,D3DX_DEFAULT, D3DUSAGE_RENDERTARGET, D3DFMT_UNKNOWN,D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, D3DCOLOR_XRGB(128,255,0), NULL, NULL,&g_pSpriteTexture) I am using now, g_Bitmap32Bits.SetColourKey(D3DCOLOR_XRGB(128,255,0)); I am clearing the surface with, g_pDevice->Clear(0,0, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,128), 0.0f, 0); The result on the screen is a Blue background, good, My Bitmap, good no green color of the keycolor, but the color around my bitmap is black? I want this blue same as the background. When i set the background to black good, but i want him BLUE. Who can help me?
Cogito Ergo Sum
Advertisement
These are just some ideas...
(1) Do you have alpha-blending enabled? (This is just a renderstate, look it up in the SDK)
(2) Instead of using D3DCOLOR_XRGB macro (which automatically puts 255 in for your alpha), try using D3DCOLOR_ARGB and specifying a lower alpha value.


Dustin Franklin
Mircrosoft DirectX MVP
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
Dustin, thanks I am going working it out.
Cogito Ergo Sum

This topic is closed to new replies.

Advertisement