Масштабирование DirectX.Direct3D.Sprite
Код:
PresentParameters present = new PresentParameters();
present.Windowed = true;
present.SwapEffect = SwapEffect.Discard;
Device device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, present);
Texture texture = TextureLoader.FromFile(device, "image2.png");
Sprite sprite = new Sprite(device);
device.BeginScene();
device.Clear(ClearFlags.Target, Color.Black, 1.0f, 0);
sprite.Begin(SpriteFlags.SortTexture | SpriteFlags.AlphaBlend);
sprite.Draw(tx, new Rectangle(SizeX * n, SizeY * m, SizeX, SizeY), new Vector3(0, 0, 0), new Vector3(poi.X, poi.Y, 0), Color.White.ToArgb());
sprite.End();
device.EndScene();
device.Present();
present.Windowed = true;
present.SwapEffect = SwapEffect.Discard;
Device device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, present);
Texture texture = TextureLoader.FromFile(device, "image2.png");
Sprite sprite = new Sprite(device);
device.BeginScene();
device.Clear(ClearFlags.Target, Color.Black, 1.0f, 0);
sprite.Begin(SpriteFlags.SortTexture | SpriteFlags.AlphaBlend);
sprite.Draw(tx, new Rectangle(SizeX * n, SizeY * m, SizeX, SizeY), new Vector3(0, 0, 0), new Vector3(poi.X, poi.Y, 0), Color.White.ToArgb());
sprite.End();
device.EndScene();
device.Present();
Нашёл решение, тему можно удалять