}
public byte[] GetImageByte()
{
byte[] _ReturnBytes = new byte[16];
_ReturnBytes[0] = m_ImageWidth;
_ReturnBytes[1] = m_ImageHeight;
_ReturnBytes[2] = m_ColorCount;
_ReturnBytes[8] = m_ImageLength[0];
_ReturnBytes[9] = m_ImageLength[1];
_ReturnBytes[10] = m_ImageLength[2];
_ReturnBytes[11] = m_ImageLength[3];
_ReturnBytes[12] = m_ImageRVA[0];
_ReturnBytes[13] = m_ImageRVA[1];
_ReturnBytes[14] = m_ImageRVA[2];
_ReturnBytes[15] = m_ImageRVA[3];
return _ReturnBytes;
}
}
private CurHead m_CurHead;
private Bitmap m_CurImage;
private IList<Image> m_CurList =new List<Image>();
public ImageCur(string p_FileFullName)
{
byte[] _FileBytes = File.ReadAllBytes(p_FileFullName);
ImageCurBytes(_FileBytes);
}
public ImageCur(byte[] p_FileBytes)
{
ImageCurBytes(p_FileBytes);
}
private void ImageCurBytes(byte[] p_Bytes)
{
m_CurHead = new CurHead(p_Bytes);
for (int i = 0; i != m_CurHead.ImageCount; i++)
{
m_CurHead.ImageWidth = (byte)BitConverter.ToInt16(p_Bytes, (int)m_CurHead.ImageRVA + 4);
m_CurHead.ImageHeight = (byte)(BitConverter.ToInt16(p_Bytes, (int)m_CurHead.ImageRVA + 8) / 2);
short _Piex = BitConverter.ToInt16(p_Bytes, (int)m_CurHead.ImageRVA + 14);
LoadImgae(_Piex, p_Bytes, (int)m_CurHead.ImageRVA + 40);
m_CurList.Add((Image)m_CurImage);
byte[] _Value = new byte[4];
_Value[3] = p_Bytes[((i + 1) * 16) + 18 + 3];
_Value[2] = p_Bytes[((i + 1) * 16) + 18 + 2];
_Value[1] = p_Bytes[((i + 1) * 16) + 18 + 1];
_Value[0] = p_Bytes[((i + 1) * 16) + 18];
m_CurHead.ImageRVA = BitConverter.ToUInt32(_Value, 0);
}
}
public ImageCur()
{
}
#region Read
private void Load32(byte[] p_FileBytes, byte[] p_NewData, int p_ReadIndex, int p_Width, int p_Height, int p_MashIndex, BitmapData p_NewBitmapData)
{
int _WriteIndex = 0;
for (int i = p_NewBitmapData.Height - 1; i != -1; i--)
{
_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] = p_FileBytes[p_ReadIndex + 3];
p_ReadIndex += 4;
}
}
}
private void Load24(byte[] p_FileBytes, byte[] p_NewData, int p_ReadIndex, int p_Width, int p_Height, int p_MashIndex, BitmapData p_NewBitmapData)
{
int _WriteIndex = 0;
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);








