title: non dword aligned pixel to dword aligned bitmap
body: <p>I have to convert a raw pixel data (rows *col = 479 * 638) which is not DWORD aligned to DWORD aligned bitmap data. I have few doubts.</p>
  
  <p>1) When I say d word aligned is it about allocating the total memory which is dword aligned or is it about making width DWORD aligned?</p>
  
  <p>2) Say if it is about making actual width as DWORD aligned , then because of DWORD alignment I'm adding extra 2 bytes at the end to make width = 640. but when I do a memcopy from source to destination it leaves a dark black line at the bottom. But I don't want these dark line since it creates a confusion from actual image. So how can I avoid this black line at the end?</p>
  
  <p>To solve this I assumed that is is about total memory allocated which is dword aligned. And I allocated that much dword aligned memory.  </p>
  
  <pre><code>bitmapData = (LPBYTE) GlobalAlloc(GMEM_FIXED, bmiHeader-&gt;biSizeImage);
  </code></pre>
  
  <p>Where  <code>bmiHeader-&gt;biSizeImage = nrows * dowrdalignedwidth * BPP.</code></p>
  
  <p>While doing the actual memcopy I am copying and writing to <code>rows*cols*BPP</code>. Is this correct?</p>