title: DirectX9 Texture of arbitrary size (non 2^n)
body: <p>I'm relatively new to DirectX and have to work on an existing C++ DX9 application. The app does tracking on a camera images and displays some DirectDraw (ie. 2d) content. The camera has an aspect ratio of 4:3 (always) and the screen is undefined.</p>
  
  <p>I want to load a texture and use this texture as a mask, so tracking and displaying of the content only are done within the masked area of the texture. Therefore I'd like to load a texture that has exactly the same size as the camera images.</p>
  
  <p>I've done all steps to load the texture, but when I call <code>GetDesc()</code> the fields <code>Width</code> and <code>Height</code> of the <code>D3DSURFACE_DESC</code> struct are of the next bigger power-of-2 size. I do not care that the actual memory used for the texture is optimized for the graphics card but I did not find any way to get the dimensions of the original image file on the harddisk.</p>
  
  <p>I do (and did, but with no success) search a possibility to load the image into the computers RAM only (graphicscard is not required) without adding a new dependency to the code. Otherwise I'd have to use OpenCV (which might anyway be a good idea when it comes to tracking), but at the moment I still try to avoid including OpenCV.</p>
  
  <p>thanks for your hints,
  Norbert</p>