Make GetBits() convert from DDB to DIB when asking for the bits, if necessary.

r=kmcclusk, sr=hyatt. bugscape bug #3322.


git-svn-id: svn://10.0.0.236/trunk@83960 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pinkerton%netscape.com 2000-12-21 22:18:15 +00:00
parent a684a2fc7f
commit f69338565d
2 changed files with 18 additions and 1 deletions

View File

@ -1265,3 +1265,20 @@ nsRect destRect;
}
/**
* Get a pointer to the bits for the pixelmap. Will convert to DIB if
* only stored in optimized HBITMAP form.
*
* @return address of the DIB pixel array
*/
PRUint8*
nsImageWin::GetBits()
{
if ( !mImageBits )
ConvertDDBtoDIB(GetWidth(), GetHeight());
return mImageBits;
} // GetBits

View File

@ -67,7 +67,7 @@ public:
virtual PRInt32 GetHeight() { return mBHead->biHeight; }
virtual PRBool GetIsRowOrderTopToBottom() { return mIsTopToBottom; }
virtual PRInt32 GetWidth() { return mBHead->biWidth; }
virtual PRUint8* GetBits() { return mImageBits; }
virtual PRUint8* GetBits() ;
virtual PRInt32 GetLineStride() { return mRowBytes; }
NS_IMETHOD SetNaturalWidth(PRInt32 naturalwidth) { mNaturalWidth= naturalwidth; return NS_OK;}