Commit 0bec2f79 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdi32: Calculate the stride from the image size.

This allows bitmaps to be created by D3DKMTCreateDCFromMemory() which have more freedom in their choice of stride. Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent a4f0415a
......@@ -154,7 +154,10 @@ static void init_dib_info(dib_info *dib, const BITMAPINFOHEADER *bi, int stride,
void init_dib_info_from_bitmapinfo(dib_info *dib, const BITMAPINFO *info, void *bits)
{
init_dib_info( dib, &info->bmiHeader, get_dib_stride( info->bmiHeader.biWidth, info->bmiHeader.biBitCount ),
int width_bytes = get_dib_stride( info->bmiHeader.biWidth, info->bmiHeader.biBitCount );
if (info->bmiHeader.biSizeImage)
width_bytes = info->bmiHeader.biSizeImage / abs( info->bmiHeader.biHeight );
init_dib_info( dib, &info->bmiHeader, width_bytes,
(const DWORD *)info->bmiColors, info->bmiColors, bits );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment