info_hdr.biSize = sizeof(info_hdr);
info_hdr.biWidth = bm.bmWidth;
- info_hdr.biHeight = bm.bmHeight;
+ info_hdr.biHeight = -bm.bmHeight;
info_hdr.biPlanes = 1;
info_hdr.biBitCount = 32;
info_hdr.biCompression = BI_RGB;
if (count > max) count = max;
ret = count;
- if (bmp->dib->dsBmih.biHeight < 0) /* top-down, need to flip contents vertically */
+ if (bmp->dib->dsBmih.biHeight >= 0) /* not top-down, need to flip contents vertically */
{
dest += dib->dsBm.bmWidthBytes * dib->dsBm.bmHeight;
while (count > 0)