title: C++ Pixels set through SetPixel are disappearing when resizing the console or moving it out of the screen
body: <p>So I am currently using the SetPixel function to recolor some pixels on the screen. But when I resize the console or move the console out of the screen, the pixels which went out of the screen are black again.</p>
  
  <p>How can I prevent them from getting black?</p>
  
  <p>regards, TPRammus</p>
  
  <p>EDIT: Here is an example: </p>
  
  <pre><code>#define _WIN32_WINNT 0x0500
  #include &lt;windows.h&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  HWND consoleWindow = GetConsoleWindow();    // Get a console handle
  
  int main()
  {
      HDC consoleDC = GetDC(consoleWindow);        // Get a handle to device context
  
      SetPixel(consoleDC, 20, 20, RGB(255, 255, 255));
  
      ReleaseDC(consoleWindow, consoleDC);
      cin.ignore();
      return 0;
  }
  </code></pre>