NewBitmapInfo = ConvertBitmapInfo(OldBitmapInfo, DIB_RGB_COLORS, &NewBitmapInfoSize, FALSE); if (NewBitmapInfo) { <do something="" with="" the="" bitmap="" info>=""> if (NewBitmapInfo != OldBitmapInfo) RtlFreeHeap(RtlGetProcessHeap(), 0, NewBitmapInfo); }
#include <precomp.h>
{
{
ClrUsed = 0;
}
else
{
BitCount = BitmapInfoHeader->biBitCount;
ClrUsed = BitmapInfoHeader->biClrUsed;
Compression = BitmapInfoHeader->biCompression;
}
switch (Compression)
{
if (BitCount != 16 && BitCount != 32)
*ColorTableSize = 0;
else
*ColorTableSize = 3;
switch (BitCount)
{
case 1:
*ColorTableSize = ClrUsed ?
min(ClrUsed, 2) : 2;
case 4:
*ColorTableSize = ClrUsed ?
min(ClrUsed, 16) : 16;
case 8:
*ColorTableSize = ClrUsed ?
min(ClrUsed, 256) : 256;
default:
if (BitCount != 16 && BitCount != 24 && BitCount != 32)
*ColorTableSize = ClrUsed;
}
if (BitCount == 4)
{
*ColorTableSize = ClrUsed ?
min(ClrUsed, 16) : 16;
}
if (BitCount == 8)
{
*ColorTableSize = ClrUsed ?
min(ClrUsed, 256) : 256;
}
*ColorTableSize = ClrUsed;
default:
}
}
{
UINT PaletteEntryCount = 0;
if ( !BitmapInfo ||
BitmapInfo->bmiHeader.biSize > sizeof(BITMAPV5HEADER))))
{
}
&PaletteEntryCount))
{
}
if (FollowedByData)
{
}
{
else
if (NewBitmapInfo ==
NULL)
{
}
if (PaletteEntryCount != 0)
{
{
{
}
}
else
{
PaletteEntryCount *
sizeof(
USHORT));
}
}
if (FollowedByData)
{
{
PaletteEntryCount);
PaletteEntryCount);
}
else
{
PaletteEntryCount *
sizeof(
USHORT);
PaletteEntryCount *
sizeof(
USHORT);
}
}
}
else
{
switch (BitmapInfo->bmiHeader.biCompression)
{
if (BitmapInfo->bmiHeader.biBitCount != 8)
if (BitmapInfo->bmiHeader.biHeight < 0)
break;
if (BitmapInfo->bmiHeader.biBitCount != 4)
if (BitmapInfo->bmiHeader.biHeight < 0)
break;
default:
break;
}
if ((BitmapInfo->bmiHeader.biCompression !=
BI_RGB) &&
{
if (BitmapInfo->bmiHeader.biSizeImage == 0)
}
}
else
return NewBitmapInfo;
}
{
#define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, pA->f, len, pW->f, len )
#define COPYN(f) pW->f = pA->f
#undef COPYN
#undef COPYS
}
{
#define COPYS(f,len) WideCharToMultiByte ( CP_THREAD_ACP, 0, pW->f, len, pA->f, len, NULL, NULL )
#define COPYN(f) pA->f = pW->f
#undef COPYN
#undef COPYS
}
{
}
{
{
switch (LpkFunctionID)
{
{
}
{
}
{
}
default:
}
}
else
}