mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
r/sr=roc Add system exception handling around the call to StretchDIBits - it fails on some printer drivers
This commit is contained in:
parent
8c7a251d5e
commit
7e18d9771a
@ -2046,11 +2046,21 @@ CompositeBitsInMemory(HDC aTheHDC, int aDX, int aDY, int aDWidth, int aDHeight,
|
||||
::GdiFlush();
|
||||
|
||||
// output the composed image
|
||||
::StretchDIBits(aTheHDC, aDX, aDY, aDWidth, aDHeight,
|
||||
aSX, aSrcy, aSWidth, aSHeight,
|
||||
screenBits, (LPBITMAPINFO)&offbmi,
|
||||
256 == aNumPaletteColors ? DIB_PAL_COLORS : DIB_RGB_COLORS,
|
||||
SRCCOPY);
|
||||
__try {
|
||||
::StretchDIBits(aTheHDC, aDX, aDY, aDWidth, aDHeight,
|
||||
aSX, aSrcy, aSWidth, aSHeight,
|
||||
screenBits, (LPBITMAPINFO)&offbmi,
|
||||
256 == aNumPaletteColors ? DIB_PAL_COLORS : DIB_RGB_COLORS,
|
||||
SRCCOPY);
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
/* yeah this is ugly - certain printer drivers crash in the StretchDIBits */
|
||||
/* workaround is to subtract one from aSrcy */
|
||||
::StretchDIBits(aTheHDC, aDX, aDY, aDWidth, aDHeight,
|
||||
aSX, aSrcy-1, aSWidth, aSHeight,
|
||||
screenBits, (LPBITMAPINFO)&offbmi,
|
||||
256 == aNumPaletteColors ? DIB_PAL_COLORS : DIB_RGB_COLORS,
|
||||
SRCCOPY);
|
||||
}
|
||||
|
||||
::SelectObject(memDC, oldBitmap);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user