Detect-It-Easy/db/CurIcoBPP
2014-06-02 09:02:47 +02:00

18 lines
469 B
Text

// Read the bits per pixel of Windows cursors & icons from the image.
// nOffset: position of the header.
function getCurIcoBPP(nOffset)
{
var nBPP=0;
nOffset=Binary.readDword(nOffset+12);
if(Binary.readDword(nOffset)==0x28)
{
nBPP=Binary.readWord(nOffset+14);
}
else if(Binary.compare("89'PNG\r\n'1A0A",nOffset))
{
// Just assume a PNG is going to be 8-bit RGBA.
nBPP=32;
}
return nBPP;
}