title: How to change, modify, cut and swap pixels from BITMAP
body: <p>I want to modify a bitmap:</p>
  
  <ul>
  <li><p>change (swap) pixel position (for later rectification of fish eye)</p></li>
  <li><p>divide bitmap in sub-bitmaps (e. g. make 4 bitmaps out of 1) (for later texturizing of different GL_QUADS)</p></li>
  </ul>
  
  <p>For this I need the code how to modify pixels of a bitmap.</p>
  
  <p>The follwing code example works and creates a texture from a file:</p>
  
  <pre><code>HBITMAP hbpInput = (HBITMAP)::LoadImage(NULL, filename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
  
  BITMAP bmpOutput;
  ::GetObject (hbpInput, sizeof (bmpOutput), &amp;bmpOutput);
  
  (...)
  
  glTexImage2D(GL_TEXTURE_2D, 0, 3, bmpOutput.bmWidth, bmpOutput.bmHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, bmpOutput.bmBits);
  </code></pre>
  
  <p>Which code is necessary to get the Bit-Array?</p>
  
  <p>I tried already GetDIBits(), but this does not work für IMAGE (struct) as you surely know :)</p>
  
  <p>Any concrete ideas how to be able to change the pixels' position?</p>
  
  <p>Thank you a lot!</p>