   sprite as userinterface in front of 3d area
  Hello everybody,I am creating a 2d userinterface in front of my 3d program with a sprite(C# without XNA). My problem is that this sprite and the containing backgroundimage is resized by the resoulution of the program.This deforms the image and makes the look of the program very badly... =(Here some example Code:private void ShowUserInterface(){   using (Sprite UISprite = new UISprite(device))   { UISprite.Begin(SpriteFlags.AlphaBlend); UISprite.Draw2D(interface, new Point(0, 0), 0f, new Point(0, 0), Color.White); UISprite.End();   }}I hope hearing from you...best regardsFreeman4gu   
  Is the image you are using for your sprite a (for some reason my brain just farted and I cant remember the term but) resolution of:8x8 or16x16 or32x32 or64x64 or128x128 or256x256 or512x512 or1024x1024 etc?if its not (enter term I forget here) the video card drivers will auto stretch your image which will do two things:1: Make it look like crap.2: Slow down rendering alot because it doesnt just do it once, but every time it needs to render it.-TonyG   ;  Your the man,my resolution was very different. Now I used the format 512x512 and all works fine. Thanks a lot...   ;  Textures in D3D need to be powers of 2 in size (The term agaudreau couldn't remember), unless the device explicitly supports non-power of 2 textures. In C++, you can check for support of that with the D3DCAPS9.TextureCaps' D3DPTEXTURECAPS_POW2 and D3DPTEXTURECAPS_NONPOW2CONDITIONAL flags.Additionally, some cards (Although I don't think it applies to any DX9 cards) require that the textures are square (I.e. width == height). Those cards set the D3DPTEXTURECAPS_SQUAREONLY cap bit.The D3DXCreateTextureFromFile[Ex]() function (Again, in C++) will always create a power of 2 texture unless you explicitly request otherwise - I wouldn't be surprised if the code you're using uses that function (directly or indirectly).   ;  direct :-PI am not understanding it at all. So can I use pictures in 512x256 format?I think I will try it.   ;  ok works fine..., thanks again   ;Quote:Original post by Freeman4guI am not understanding it at all. So can I use pictures in 512x256 format?Only if the D3DPTEXTURECAPS_SQUAREONLY cap bit is not set (Which is the case in almost every card out there). So it should be fine, but it may be worth checking for support if you care about (very) old cards.   