Archived

This topic is now archived and is closed to further replies.

Thread

Transparant Bitmap in DX 9.0b 3D

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites