title: How to calculate Framebuffer pitch?
body: <p>I got a UI application which render output to an off-screen framebuffer in 16, 24 or 32 bpp respectively.</p>
  
  <p>I need to calculate pitch, my understanding is pitch is number of bytes in one scanline, is it equal to screenx*bitsperpixel? Though apparently it does not produce correct result.</p>
  
  <p>Can we have a formula (generic) to calculate pitch?</p>