title: How to Use TextureBrush for painting an Image
body: <p>Using GDI+ I am attempting to make a simple square that consists of an image. This rectangle will be moved. There are a few issues I've been running into. First of all, how to locally refer to the image (it is set to always copy), how to get the image centered in the square, and how to keep the image stationary when the square moves?</p>
  
  <pre><code>Bitmap runnerImage = (Bitmap)Image.FromFile(@"newRunner.bmp", true);//this results in an error without full path
  
  TextureBrush imageBrush = new TextureBrush(runnerImage);
  
  imageBrush.WrapMode = System.Drawing.Drawing2D.WrapMode.Clamp;//causes the image to get smaller/larger if movement is tried
  
  Graphics.FillRectangle(imageBrush, displayArea);
  </code></pre>
  
  <p>Without using wrapMode.clamp it defaults to tiling, which looks like the image is tiled and moving the square moves from one image to the next</p>