title: Moving a transparent image in a picturebox
body: <p>For a project, I'm making a game and in it I have a scrolling map. The map moves left and right and is redrawn in a picturebox so that I can have a large map in a small picturebox. The top portion of the map is transparent so that I can change the sky colour later on. However when I move the map, the transparent part glitches out.</p>
  
  <p><a href="http://imgur.com/VU5BzUj" rel="nofollow">Original map before moving</a></p>
  
  <p><a href="http://imgur.com/5EFYMSb" rel="nofollow">After moving the map a bit</a></p>
  
  <p>As you can see, everything above the tree line gets stretched, that is because that is where the transparency starts. The picturebox's parent is the form and the form is light blue, which is why the background is light blue.</p>
  
  <p>Here is my code for moving the picture/redrawing it onto the picturebox:</p>
  
  <pre><code>private void timerTick_Tick(object sender, EventArgs e)
  {
      move();
      //Draws new portion of the map
      g.DrawImage(image, new Rectangle(0, 0, pbMap.Width, pbMap.Height), new Rectangle(imageX, imageY, pbMap.Width, pbMap.Height), GraphicsUnit.Pixel);
      //Refreshes
      pbMap.Image = bmp;
  
  }
  
  private void move()
  {
      //Right arrow events
      if (right)
      {
          imageX += mapSpeed;
          //Makes sure the picture stays within borders
          if (imageX &gt;= (imageWidth - pbMap.Width))
          {
              imageX = imageWidth - pbMap.Width;
          }         
      }
  
      //Left arrow events
      if (left)
      {
          imageX -= mapSpeed;
          //Makes sure the picture stays within borders
          if (imageX &lt;= 0)
          {
              imageX = 0;                 
          }      
      }
  }
  </code></pre>
  
  <p>Can anyone help explain the glitching?</p>