   How do I get D3DXLoadSurfaceFromFile to have trancparentcy?
  The issue is that my program draws a black box around the bmp when I want it not to draw anything that is solid green or 0,255,0.What do I need to add or change to get that to work?LPDIRECT3DSURFACE9 image = NULL;//get width and height from bitmap fileD3DXIMAGE_INFO info;HRESULT result = D3DXGetImageInfoFromFile(filename.c_str(), &info);if (result != D3D_OK) return NULL;//create surfaceresult = d3ddev->CreateOffscreenPlainSurface(info.Width,    //width of the surfaceinfo.Height,   //height of the surfaceD3DFMT_X8R8G8B8,    //surface formatD3DPOOL_DEFAULT,    //memory pool to use&image,   //pointer to the surfaceNULL);    //reserved (always NULL) if (result != D3D_OK) return NULL;    //load surface from file into newly created surface result = D3DXLoadSurfaceFromFile(image,   //destination surfaceNULL,    //destination paletteNULL,    //destination rectanglefilename.c_str(),  //source filenameNULL,    //source rectangleD3DX_DEFAULT, //controls how image is filteredD3DCOLOR_XRGB(0,255,0),   //for transparency (0 for none)NULL);   //source image info (usually NULL) //make sure file was loaded okay if (result != D3D_OK) return NULL; return image;
  Try creating a D3DFMT_A8R8G8B8 image instead - you need an alpha channel to get transparency. Also make sure the alpha blending render states are set correctly when you draw it.   ;  Thanks I will try that as soon as I can get my program to compile.the issue is1>MyDirectX.obj : error LNK2001: unresolved external symbol "struct ID3DXSprite * spriteobj" (?spriteobj@@3PAUID3DXSprite@@A)1>MyGame.obj : error LNK2001: unresolved external symbol "struct ID3DXSprite * spriteobj" (?spriteobj@@3PAUID3DXSprite@@A)this is what I have//libraries#pragma comment(lib,"d3dx9.lib")#pragma comment(lib,"winmm.lib")#pragma comment(lib,"user32.lib")#pragma comment(lib,"gdi32.lib")#pragma comment(lib,"dxguid.lib")#pragma comment(lib,"d3dxof.lib")#pragma comment(lib,"d3d9.lib")#pragma comment(lib,"d3dx9d.lib")#pragma comment(lib,"dinput8.lib")#pragma comment(lib,"xinput.lib")#include <d3dx9.h>#include <windows.h>#include <d3d9.h>#include <dinput.h>#include <xinput.h>#include <ctime>#include <iostream>#include <iomanip>I also have the folders set right becuase it was working tell I tryed adding LPD3DXSPRITE to the project and now for some reason its not finding the lib or I am starting it wrongextern LPD3DXSPRITE spriteobj; D3DXCreateSprite(d3ddev, &spriteobj);D3DXVECTOR3 pos2( bomb.x,  bomb.y, 0);  spriteobj->Draw( bomb_surf,NULL ,NULL, &pos2, D3DCOLOR_XRGB(255,255,255));if (spriteobj) spriteobj->Release();other then that I have no ideaI am using vc++ 2010and windows 7 64bit;  You have:extern LPD3DXSPRITE spriteobj;Which tells the compiler that a LPD3DXSPRITE named spriteobj exists, but you don't declare it anywhere. You need to add this in one .cpp file at global scope:LPD3DXSPRITE spriteobj = NULL;Also, about the original problem: If you want alpha, you almost certainly want to use textures rather than surfaces, especially if you're using ID3DXSprite - in which case you should be using D3DXCreateTextureFromFileEx instead of D3DXLoadSurfaceFromFile.   ;  thanks that was what the issue was.Its working now but its going way to fast and I am tring to figure a way to slow the images down.   