I'm trying to resize a DirectX Texture and place it in the top right corner of the window. I am drawing the texture using a sprite, here's is my code (I am using SharpDX):
albumArtSprite.Begin();
NativeMethods.RECT rect;
NativeMethods.GetClientRect(device.CreationParameters.HFocusWindow, out rect);
float targetDimensions = 150f;
var matrix = Matrix.Scaling(targetDimensions / albumArtInformation.Width, targetDimensions / albumArtInformation.Height, 0f) *
Matrix.Translation(rect.Width - albumArtInformation.Width - 10f, 10f, 0f);
albumArtSprite.Transform = matrix;
albumArtSprite.Draw(albumArtTexture, new ColorBGRA(0xFFFFFFFF));
albumArtSprite.End();
For some reason, I'm getting really strange results like the image not being where I want it to be which is in the top-right hand corner of the window with an offset of 10 on the X and Y axis. It's my first time working with DirectX so I'm not 100% sure about this matrix stuff.