   [SlimDX] Transitioning from MDX to SlimDX
  I've wrote a rather extensive MDX application that I used on almost a daily basis, but with Windows 7 coming out, the application doesn't work anymore in that new OS.  So I thought I'd update it and try out using SlimDX instead.A few of the problems I'm trying to figure out, is that the way my old MDX worked is I would load user images (everything is 2d), not always a power of 2, into sprites and draw them to the screen.  Well with SlimDX, I haven't found a way to draw where I can define the Destination Rectangle like I could with MDX.  I was looking into using a Matrix to scale the image, but I can't, with SlimDX Textures, find a way to find out the loaded textures size.  Is there just something I'm missing?   
  Try looking at:texture.GetSurfaceLevel(0).Description.Width;texture.GetSurfaceLevel(0).Description.Height;GetSurfaceLevel gets the highest mipmap level of the surface, which should correspond to the image you loaded.Alternatively, you could just load the image using System.Drawing.Bitmap, inspect the size, and dispose of the bitmap.  But that's very round-about.Edit: Now I look at my own code base and see that I'm loading the surface as a bitmap object first to get the size.  So I don't know if there's a better way to go than that for NPOT textures.[Edited by - kanato on May 13, 2009 1:55:51 AM];  What were you using in MDX to accomplish this? Chances are that the functionality just got moved around a bit.   ;  Yea, before it was all done with Sprite.Draw2D which I had inside a class module to handle many sprites that were being drawn.Dim destRect As New Rectangle(p_position.X, p_position.Y, p_size.Width, p_size.Height)p_sprite.Draw2D(Me.Image, srcRect, destRect, p_position, RenderColor)I can't seem to find SlimDX's equivelant if there is one.  I'll try using the surface level so I can get the right number to scale it by and see how that works out.   ;  Dim xScale As Single = 194 / SpriteImage.GetSurfaceLevel(0).Description.Width   Dim yScale As Single = 280 / SpriteImage.GetSurfaceLevel(0).Description.Height   Dim SpriteMatrix As New Matrix()   Dim x = SpriteImage.CreationSource.GetFrame(0).GetFileName()   Matrix.Scaling(New Vector3(xScale, yScale, 0), SpriteMatrix)   Sprite.Transform = SpriteMatrix   Sprite.Begin(SpriteFlags.AlphaBlend)   Sprite.Draw(SpriteImage, Vector3.Zero, New Vector3(100, 20, 0), SpriteColor)   Sprite.End()Yea, those two Width and Height give me the P.O.T. dimensions that directx skews it to.  Guess I'll have to load it into a bitmap to get its real dimensions.   ;  So after using tranform on a sprite, it seems that since I scaled it, it also scales the position that i've passed in a vector3.  Any ideas why a scale of size would adjust the location as well?   ;  Setting the Transform affects everything.  If you want to scale only the sprite's size, you need to pass the scale in the Draw method.   