title: pixel with specyfic color is not in the position it was put in SFML
body: <p>I want to have possibility of load image into window and then read specific pixel, change its colour and finally put the pixel something else. Unfortunately reading pixels does not work:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  #include &lt;SFML/Graphics.hpp&gt;
  #include &lt;SFML/config.hpp&gt;
  
  inline bool isOnScreen(const sf::RenderWindow&amp; screen, int x, int y)
  {
      return 0 &lt;= x &amp;&amp; x &lt; screen.getSize().x  &amp;&amp; 0 &lt;=y &amp;&amp; y &lt; screen.getSize().y;
  }
  
  void setPixelColor(sf::RenderWindow&amp; screen, int x, int y, const sf::Color&amp; color)
  {
      if (isOnScreen(screen, x, y))
      {
          sf::Vertex vertex(sf::Vector2f(x, y), color);
          screen.draw(&amp;vertex, 1, sf::Points);
      }
      else
      {
          cerr &lt;&lt; "point " &lt;&lt; x &lt;&lt; ", " &lt;&lt; y &lt;&lt; " out of screen, which is: " &lt;&lt; screen.getSize().x &lt;&lt; ", " &lt;&lt; screen.getSize().y &lt;&lt; "!\n";
      }
  }
  
  sf::Color getPixelColor(sf::RenderWindow&amp; screen, int x, int y)
  {
      if (isOnScreen(screen, x, y))
      {
          return screen.capture().getPixel(x, y);
      }
      cerr &lt;&lt; "Out of stage: " &lt;&lt; x &lt;&lt; ", " &lt;&lt; y &lt;&lt; endl;
      return sf::Color::Transparent;
  }
  
  void printColor(const sf::Color&amp; color)
  {
      cout &lt;&lt; "Color: " &lt;&lt; (int)color.r &lt;&lt; ", " &lt;&lt; (int)color.g &lt;&lt; ", " &lt;&lt; (int)color.b &lt;&lt; '\n';
  }
  
  int main()
  {
      sf::RenderWindow screen(sf::VideoMode(900, 600), "window");
  
      sf::Color myColor{255, 128, 0};
  
      int x=10, y=10;
      setPixelColor(screen, x, y, myColor);
  
      auto readColor = getPixelColor(screen, x, y); // it is 0, 0, 0
      printColor(readColor);
  
      screen.display();
  
      while (screen.isOpen())
      {
          sf::Event event;
          while (screen.pollEvent(event))
          {
              if (sf::Event::Closed == event.type)
              {
                      screen.close();
                      break;
              }
          }
      }
  }
  </code></pre>
  
  <p>I don't know why the read colour from the same place where I've put its is 0, 0, 0.
  The strange thing is that the valid colour is in position below the position I've put its:</p>
  
  <pre><code>    readColor = getPixelColor(screen, x, y-1); // it is valid colour
      printColor(readColor);
  </code></pre>
  
  <p>it can be some kind of dirty solution, but sometimes I need to read pixel from position y=0, so in this situation my hack does not works.</p>
  
  <p>My current SFML version is <strong>SFML-2.4.2 gcc-4.9.2-tdm-32-bit</strong> on Windows 7</p>