   Problem with Texture rectangle coordinates
  I've just been experimenting with writing a simple 2D app using DirectX/C# but I've come across a problem when attempting to draw a sprite using the Sprite.Draw() method.I am loading in a 64x64 pixel bitmap containing a number of frames of animation to use as the texture for the sprite and am defining a rectangle containing the portion of the texture to use for the sprite. I have found though that the coordinates I use for the rectangle do not exactly match the portion of the texture that is drawn to the screen.The texture bitmap has borders around each animation frame which are also odd sizes so creating a rectangle using new Rectangle ( 2, 2, 17, 19 ); for instance should give a rectangle covering one of the 17x19 pixel frames but I actually have to define the top left coordinates as (2, 4) for the sprite to display properly without showing the top border even though the coordinates should definitely be (2, 2).Can anyone shed some light upon why this is happening?Thanks,Andy   
  The only time I have had trouble doing this is when my original texture file isn't a power of 2.   ;Quote:Original post by dgeussThe only time I have had trouble doing this is when my original texture file isn't a power of 2.The texture is a 64 x 64 pixel bitmap so I don't think that this will be the cause of the problem :(