This commit is contained in:
NYAN CAT 2019-05-07 21:08:51 -07:00
parent 1c22b0b2c4
commit d05f2050a5
2 changed files with 0 additions and 50 deletions

View File

@ -289,31 +289,6 @@ namespace StreamLibrary.UnsafeCodecs
return decodedBitmap;
}
return decodedBitmap;
byte* bufferPtr = (byte*)CodecBuffer.ToInt32();
if (DataSize > 0)
{
Graphics g = Graphics.FromImage(decodedBitmap);
for (int i = 4; DataSize > 0; )
{
Rectangle rect = new Rectangle(*(int*)(bufferPtr + i), *(int*)(bufferPtr + i + 4),
*(int*)(bufferPtr + i + 8), *(int*)(bufferPtr + i + 12));
int UpdateLen = *(int*)(bufferPtr + i + 16);
byte[] temp = new byte[UpdateLen];
fixed(byte* tempPtr = temp)
{
NativeMethods.memcpy(new IntPtr(tempPtr), new IntPtr(CodecBuffer.ToInt32() + i + 20), (uint)UpdateLen);
using (Bitmap TmpBmp = new Bitmap(rect.Width, rect.Height, rect.Width * 3, decodedBitmap.PixelFormat, new IntPtr(tempPtr)))
{
g.DrawImage(TmpBmp, new Point(rect.X, rect.Y));
}
}
DataSize -= UpdateLen + (4 * 5);
i += UpdateLen + (4 * 5);
}
g.Dispose();
}
return decodedBitmap;
}
public override Bitmap DecodeData(Stream inStream)

View File

@ -289,31 +289,6 @@ namespace Client.StreamLibrary.UnsafeCodecs
return decodedBitmap;
}
return decodedBitmap;
byte* bufferPtr = (byte*)CodecBuffer.ToInt32();
if (DataSize > 0)
{
Graphics g = Graphics.FromImage(decodedBitmap);
for (int i = 4; DataSize > 0; )
{
Rectangle rect = new Rectangle(*(int*)(bufferPtr + i), *(int*)(bufferPtr + i + 4),
*(int*)(bufferPtr + i + 8), *(int*)(bufferPtr + i + 12));
int UpdateLen = *(int*)(bufferPtr + i + 16);
byte[] temp = new byte[UpdateLen];
fixed(byte* tempPtr = temp)
{
NativeMethods.memcpy(new IntPtr(tempPtr), new IntPtr(CodecBuffer.ToInt32() + i + 20), (uint)UpdateLen);
using (Bitmap TmpBmp = new Bitmap(rect.Width, rect.Height, rect.Width * 3, decodedBitmap.PixelFormat, new IntPtr(tempPtr)))
{
g.DrawImage(TmpBmp, new Point(rect.X, rect.Y));
}
}
DataSize -= UpdateLen + (4 * 5);
i += UpdateLen + (4 * 5);
}
g.Dispose();
}
return decodedBitmap;
}
public override Bitmap DecodeData(Stream inStream)