mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
- Implement DIB section attribute flag support.
- Fix height negativity being passed to NtGdiCreateCompatibleBitmap. See bug 3947. svn path=/trunk/; revision=38101
This commit is contained in:
parent
e9d55d0638
commit
8a3fedace3
1 changed files with 16 additions and 5 deletions
|
@ -1018,8 +1018,9 @@ NtGdiStretchDIBitsInternal(
|
|||
return 0;
|
||||
}
|
||||
|
||||
hBitmap = NtGdiCreateCompatibleBitmap(hDC, BitsInfo->bmiHeader.biWidth,
|
||||
BitsInfo->bmiHeader.biHeight);
|
||||
hBitmap = NtGdiCreateCompatibleBitmap( hDC,
|
||||
BitsInfo->bmiHeader.biWidth,
|
||||
abs(BitsInfo->bmiHeader.biHeight));
|
||||
if (hBitmap == NULL)
|
||||
{
|
||||
DPRINT1("NtGdiCreateCompatibleBitmap fail create bitmap\n");
|
||||
|
@ -1302,14 +1303,19 @@ HBITMAP APIENTRY NtGdiCreateDIBSection(HDC hDC,
|
|||
|
||||
HBITMAP APIENTRY
|
||||
DIB_CreateDIBSection(
|
||||
PDC dc, BITMAPINFO *bmi, UINT usage,
|
||||
LPVOID *bits, HANDLE section,
|
||||
DWORD offset, DWORD ovr_pitch)
|
||||
PDC dc,
|
||||
BITMAPINFO *bmi,
|
||||
UINT usage,
|
||||
LPVOID *bits,
|
||||
HANDLE section,
|
||||
DWORD offset,
|
||||
DWORD ovr_pitch)
|
||||
{
|
||||
HBITMAP res = 0;
|
||||
BITMAPOBJ *bmp = NULL;
|
||||
DIBSECTION *dib = NULL;
|
||||
void *mapBits = NULL;
|
||||
PDC_ATTR pDc_Attr;
|
||||
|
||||
// Fill BITMAP32 structure with DIB data
|
||||
BITMAPINFOHEADER *bi = &bmi->bmiHeader;
|
||||
|
@ -1329,6 +1335,9 @@ DIB_CreateDIBSection(
|
|||
return (HBITMAP)NULL;
|
||||
}
|
||||
|
||||
pDc_Attr = dc->pDc_Attr;
|
||||
if ( !pDc_Attr ) pDc_Attr = &dc->Dc_Attr;
|
||||
|
||||
effHeight = bi->biHeight >= 0 ? bi->biHeight : -bi->biHeight;
|
||||
bm.bmType = 0;
|
||||
bm.bmWidth = bi->biWidth;
|
||||
|
@ -1523,6 +1532,8 @@ DIB_CreateDIBSection(
|
|||
*bits = bm.bmBits;
|
||||
}
|
||||
|
||||
if (res) pDc_Attr->ulDirty_ |= DC_DIBSECTION;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue