title: Bitmap to Iplimage conversion produce wrong color
body: <p>i am trying to convert a bitmap to opencv image i am using pinvoke by sending the Bitmap.Scan0 and in the unmanaged side i am creating iplimage by using the byte array  the solution is seems to work but not always ! only if i created the image on my pc using my grahpic device but it fails on another the image colors seems to be not right and the image is shifted  i am suspecting that i should transfer the bitmap to DIB how can this done ? </p>
  
  <pre><code>IplImage* image= cvCreateImage(cvSize(width,height),depth,3)
  memcpy(image-&gt;imageData,(uchar*)(bitmap),width*height*3);
  </code></pre>