for (int i = p_NewBitmapData.Height - 1; i != -1; i--)
{
p_MashIndex = (p_Height - 1 - i) * (_MashStride * 8);
_WriteIndex = i * p_NewBitmapData.Stride;
for (int z = 0; z != p_NewBitmapData.Width; z++)
{
p_NewData[_WriteIndex + (z * 4)] = p_FileBytes[p_ReadIndex];
p_NewData[_WriteIndex + (z * 4) + 1] = p_FileBytes[p_ReadIndex + 1];
p_NewData[_WriteIndex + (z * 4) + 2] = p_FileBytes[p_ReadIndex + 2];
p_NewData[_WriteIndex + (z * 4) + 3] = 0xFF;
if (_MashArray[p_MashIndex])p_NewData[_WriteIndex + (z * 4) + 3] = 0x00; //
p_ReadIndex += 3;
p_MashIndex++;
}
}
}
private void Load8(byte[] p_FileBytes, byte[] p_NewData, int p_ReadIndex, int p_Width, int p_Height, int p_MashIndex, BitmapData p_NewBitmapData)
{
int _WriteIndex = 0;
Hashtable _ColorHashTable = new Hashtable();
for (int i = 0; i != 256; i++)
{
_ColorHashTable.Add(i.ToString(), Color.FromArgb(p_FileBytes[p_ReadIndex + 3], p_FileBytes[p_ReadIndex + 2], p_FileBytes[p_ReadIndex + 1], p_FileBytes[p_ReadIndex]));
p_ReadIndex += 4;
}
p_MashIndex = p_Width * p_Height + p_ReadIndex;
int _MashStride = p_Width / 8;
if (p_Width % 8 != 0) _MashStride++;
if (_MashStride % 4 !=0) _MashStride += _MashStride % 4;
byte[] _MashBytes = new byte[_MashStride * p_Height];
Array.Copy(p_FileBytes, p_MashIndex, _MashBytes, 0, _MashBytes.Length);
for (int i = 0; i != _MashBytes.Length; i++)
{
_MashBytes[i] = ConvertByte.OperateData.ReverseByte(_MashBytes[i]);
}
BitArray _MashArray = new BitArray(_MashBytes);
for (int i = p_NewBitmapData.Height - 1; i != -1; i--)
{
p_MashIndex = (p_Height - 1 - i) * (_MashStride * 8);
_WriteIndex = i * p_NewBitmapData.Stride;
for (int z = 0; z != p_NewBitmapData.Width; z++)
{
byte _Index = p_FileBytes[p_ReadIndex];
Color _SetColor = (Color)_ColorHashTable[_Index.ToString()];
p_NewData[_WriteIndex + (z * 4)] = (byte)_SetColor.B;
p_NewData[_WriteIndex + (z * 4) + 1] = (byte)_SetColor.G;
p_NewData[_WriteIndex + (z * 4) + 2] = (byte)_SetColor.R;
p_NewData[_WriteIndex + (z * 4) + 3] = 0xFF;
if (_MashArray[p_MashIndex])p_NewData[_WriteIndex + (z * 4) + 3] = 0x00; //
p_ReadIndex++;
p_MashIndex++;
}
}
}
private void Load4(byte[] p_FileBytes, byte[] p_NewData, int p_ReadIndex, int p_Width, int p_Height, int p_MashIndex, BitmapData p_NewBitmapData)
{
int _WriteIndex = 0;
Hashtable _ColorHashTable = new Hashtable();
for (int i = 0; i != 16; i++)
{
_ColorHashTable.Add(i.ToString(), Color.FromArgb(p_FileBytes[p_ReadIndex + 3], p_FileBytes[p_ReadIndex + 2], p_FileBytes[p_ReadIndex + 1], p_FileBytes[p_ReadIndex]));
p_ReadIndex += 4;
}
p_MashIndex = (p_Width * p_Height / 2) + p_ReadIndex;
int _MashStride = p_Width / 8;
if (p_Width % 8 != 0) _MashStride++;
if (_MashStride % 4 != 0) _MashStride += _MashStride % 4;
byte[] _MashBytes = new byte[_MashStride * p_Height];
Array.Copy(p_FileBytes, p_MashIndex, _MashBytes, 0, _MashBytes.Length);








