wxCreateDIB() seems to be unused, removed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47423 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1581,57 +1581,6 @@ bool wxBitmapHandler::SaveFile(wxBitmap *WXUNUSED(bitmap),
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// DIB functions
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#ifndef __WXMICROWIN__
|
|
||||||
bool wxCreateDIB(long xSize, long ySize, long bitsPerPixel,
|
|
||||||
HPALETTE hPal, LPBITMAPINFO* lpDIBHeader)
|
|
||||||
{
|
|
||||||
unsigned long i, headerSize;
|
|
||||||
|
|
||||||
// Allocate space for a DIB header
|
|
||||||
headerSize = (sizeof(BITMAPINFOHEADER) + (256 * sizeof(PALETTEENTRY)));
|
|
||||||
LPBITMAPINFO lpDIBheader = (BITMAPINFO *) malloc(headerSize);
|
|
||||||
LPPALETTEENTRY lpPe = (PALETTEENTRY *)((BYTE*)lpDIBheader + sizeof(BITMAPINFOHEADER));
|
|
||||||
|
|
||||||
GetPaletteEntries(hPal, 0, 256, lpPe);
|
|
||||||
|
|
||||||
memset(lpDIBheader, 0x00, sizeof(BITMAPINFOHEADER));
|
|
||||||
|
|
||||||
// Fill in the static parts of the DIB header
|
|
||||||
lpDIBheader->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
|
||||||
lpDIBheader->bmiHeader.biWidth = xSize;
|
|
||||||
lpDIBheader->bmiHeader.biHeight = ySize;
|
|
||||||
lpDIBheader->bmiHeader.biPlanes = 1;
|
|
||||||
|
|
||||||
// this value must be 1, 4, 8 or 24 so PixelDepth can only be
|
|
||||||
lpDIBheader->bmiHeader.biBitCount = (WORD)(bitsPerPixel);
|
|
||||||
lpDIBheader->bmiHeader.biCompression = BI_RGB;
|
|
||||||
lpDIBheader->bmiHeader.biSizeImage = (xSize * abs(ySize) * bitsPerPixel) >> 3;
|
|
||||||
lpDIBheader->bmiHeader.biClrUsed = 256;
|
|
||||||
|
|
||||||
|
|
||||||
// Initialize the DIB palette
|
|
||||||
for (i = 0; i < 256; i++) {
|
|
||||||
lpDIBheader->bmiColors[i].rgbReserved = lpPe[i].peFlags;
|
|
||||||
lpDIBheader->bmiColors[i].rgbRed = lpPe[i].peRed;
|
|
||||||
lpDIBheader->bmiColors[i].rgbGreen = lpPe[i].peGreen;
|
|
||||||
lpDIBheader->bmiColors[i].rgbBlue = lpPe[i].peBlue;
|
|
||||||
}
|
|
||||||
|
|
||||||
*lpDIBHeader = lpDIBheader;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxFreeDIB(LPBITMAPINFO lpDIBHeader)
|
|
||||||
{
|
|
||||||
free(lpDIBHeader);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// global helper functions implemented here
|
// global helper functions implemented here
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user