1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22:
| protected override void OnPaint(PaintEventArgs e) { device.Clear(ClearFlags.Target, Color.Black, 1.0f, 0); device.BeginScene(); sprite.Begin(SpriteFlags.AlphaBlend);
Rectangle textureSize; using (Surface surface = textur.GetSurfaceLevel(0)) { SurfaceDescription surfaceDescription = surface.Description; textureSize = new Rectangle(0, 0, surfaceDescription.Width, surfaceDescription.Height); } sprite.Draw(textur, textureSize, Vector3.Empty, Vector3.Empty, Color.White);
sprite.End(); device.EndScene(); device.Present();
Invalidate(); } |