when selecting a bitmap into a drawing surface, we now reselect the bitmap

that used to be there when we're done.
This commit is contained in:
michaelp 1998-05-05 22:39:19 +00:00
Родитель 26b34368ef
Коммит 3d295d74ad
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -162,11 +162,14 @@ PRBool nsImageWin :: Draw(nsIRenderingContext &aContext, nsDrawingSurface aSurfa
if (NULL != srcdc)
{
SelectObject(srcdc, mHBitmap);
HBITMAP oldbits = ::SelectObject(srcdc, mHBitmap);
if (!::StretchBlt(the_hdc, aDX, aDY, aDWidth, aDHeight, srcdc, aSX, aSY,
aSWidth, aSHeight, SRCCOPY))
error = ::GetLastError();
if (nsnull != oldbits)
::SelectObject(srcdc, oldbits);
}
NS_RELEASE(dx);
@ -203,13 +206,16 @@ PRBool nsImageWin :: Draw(nsIRenderingContext &aContext, nsDrawingSurface aSurfa
if (NULL != srcdc)
{
SelectObject(srcdc, mHBitmap);
HBITMAP oldbits = ::SelectObject(srcdc, mHBitmap);
//if((aWidth == mBHead->biWidth) && (aHeight == mBHead->biHeight))
//BitBlt(the_hdc,aX,aY,aWidth,aHeight,mOptimizeDC,0,0,SRCCOPY);
if (!::StretchBlt(the_hdc, aX, aY, aWidth, aHeight, srcdc, 0, 0,
mBHead->biWidth, mBHead->biHeight, SRCCOPY))
error = ::GetLastError();
if (nsnull != oldbits)
::SelectObject(srcdc, oldbits);
}
NS_RELEASE(dx);