Newer KMS wz introduces a new PNG format--format 257(A1R5G5B5).The new NPCs with IDs starting with 257XXXX.img
PHP Code:
case 257:
{
pngDecoded = new Bitmap(this.w, this.h, PixelFormat.Format16bppArgb1555);
bmpdata = pngDecoded.LockBits(new Rectangle(Point.Empty, pngDecoded.Size), ImageLockMode.WriteOnly, PixelFormat.Format16bppArgb1555);
CopyBmpDataWithStride(pixel, pngDecoded.Width * 2, bmpdata);
pngDecoded.UnlockBits(bmpdata);
break;
}
........
........
public static void CopyBmpDataWithStride(byte[] source, int stride, BitmapData bmpData)
{
if (bmpData.Stride == stride)
{
Marshal.Copy(source, 0, bmpData.Scan0, source.Length);
}
else
{
for (int y = 0; y < bmpData.Height; y++)
{
Marshal.Copy(source, stride * y, bmpData.Scan0 + bmpData.Stride * y, stride);
}
}
}