title: Need SlimDX to display images quickly
body: <p>I need to display images very quickly (about 60 FPS).  Picturebox/Panel doesn't do the job at higher resolutions, so I am now turning to SlimDX, which I hope is the right move.</p>
  
  <p>As SlimDX uses Directx, and DirectX uses the GPU, I should be able to do it very quickly.  From my understanding, the GPU works with images a lot faster than with the CPU.</p>
  
  <p>I am doing this:</p>
  
  <pre><code>MessagePump.Run(form, () =&gt;
  {
      device.BeginScene();
      sprite.Begin(SlimDX.Direct3D9.SpriteFlags.None);
      tx = SlimDX.Direct3D9.Texture.FromStream(device, (new MemoryStream(reader.ReadBytes(reader.ReadInt32()))), SlimDX.Direct3D9.Usage.None, SlimDX.Direct3D9.Pool.Managed);
      sprite.Draw(tx, Color.Transparent);
  
      sprite.End();
      device.EndScene();
      device.Present();
  });
  </code></pre>
  
  <p>And initializing everything:</p>
  
  <pre><code>var form = new RenderForm("Test");
  form.Width = 1280;
  form.Height = 720;
  SlimDX.Direct3D9.PresentParameters presentParams = new SlimDX.Direct3D9.PresentParameters
  {
   BackBufferWidth = form.Width,
   BackBufferHeight = form.Height,
   DeviceWindowHandle = form.Handle,
   PresentFlags = SlimDX.Direct3D9.PresentFlags.None,
   BackBufferCount = 0,
   PresentationInterval = SlimDX.Direct3D9.PresentInterval.Immediate,
   SwapEffect = SlimDX.Direct3D9.SwapEffect.Discard,
   BackBufferFormat = SlimDX.Direct3D9.Format.A8R8G8B8,
   Windowed = true,
  };
  
  device = new SlimDX.Direct3D9.Device(new SlimDX.Direct3D9.Direct3D(), 0, SlimDX.Direct3D9.DeviceType.Hardware, form.Handle, SlimDX.Direct3D9.CreateFlags.HardwareVertexProcessing, presentParams);
  device.Viewport = new SlimDX.Direct3D9.Viewport(0, 0, form.Width, form.Height);
      SlimDX.Direct3D9.Sprite sprite;
      SlimDX.Direct3D9.Texture tx;
      sprite = new SlimDX.Direct3D9.Sprite(device);
      tx = new SlimDX.Direct3D9.Texture(device, form.Width, form.Height, 0, SlimDX.Direct3D9.Usage.None, SlimDX.Direct3D9.Format.X8R8G8B8, SlimDX.Direct3D9.Pool.Managed);
  </code></pre>
  
  <p>There are two problems with this:</p>
  
  <ol>
  <li>it's extremely slow; picturebox is much faster</li>
  <li>it shows the image incorrectly (it's zoomed in)</li>
  </ol>
  
  <p><img src="https://i.stack.imgur.com/7BIMY.png" alt="enter image description here"></p>