title: C# Move bitmap in picturebox
body: <p>I create image with LockBits from array in cycle and scale to PictureBox.Width * n and Height:</p>
  
  <pre><code>using (var bmp = new Bitmap(len, _height, PixelFormat.Format24bppRgb))
  {
              var data = bmp.LockBits(new Rectangle(0, 0, len, _height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
              var bytes = data.Stride * data.Height;
              var rgb = new byte[bytes];
              var ptr = data.Scan0;
              Marshal.Copy(data.Scan0, rgb, 0, bytes);
  
  
              // …fill array „rgb“
  
              Marshal.Copy(rgb, 0, ptr, bytes);
              bmp.UnlockBits(data);
  
              g = _pictureBox.CreateGraphics();
              g.InterpolationMode = InterpolationMode.Default;
              g.DrawImage(bmp, _pictureBox.Width - len * _scaleWidth, 0, len * _scaleWidth, _pictureBox.Height);
  }
  </code></pre>
  
  <p>In the next iterateration:</p>
  
  <pre><code>Graphics g;
          using (var bmp = new Bitmap(_pictureBox.Image))
          {
              g = _pictureBox.CreateGraphics();
              g.InterpolationMode = InterpolationMode.Default;
              g.DrawImage(_pictureBox.Image, new RectangleF(0, 0, _pictureBox.Width - len * _scaleWidth, _pictureBox.Height), new RectangleF(len * _scaleWidth, 0, _pictureBox.Width * _scaleWidth - len, _height), GraphicsUnit.Pixel);
          }
          g.Dispose();
  </code></pre>
  
  <p>In short: I cut and copy part of the image that would shift the picture, but do not get anything. Is it possible because of the scale in the previous step?
  Maybe I'm wrong. Advise the algorithm for shifting and adding a new Bitmap into an end.</p>