title: Shrink image using C++
body: <p>I've been trying to shrink an image just using C++. I am quite new to this language.</p>
  <p>This is what I have and it works but there is a problem where it leaves unwanted pixels behind.</p>
  <pre><code>    Rgb temp;
      float scale = 0.8;
      for(int y = 0; y &lt; h*scale; y++)
      {
          int scaleY = (int)(y/scale);
          for(int x = 0; x &lt; w*scale; x++) {
              int scaleX = (int) (x / scale);
              temp = pixels[x + y * w];
              pixels[x + y * w] = pixels[scaleX + scaleY * w];
              pixels[scaleX + scaleY * w] = temp;
          }
      }
  </code></pre>
  <p>I have been looking online and haven't found many examples that just use basic C++. I'd appreciate any help.</p>