Ejemplo n.º 1
0
        static public void Export(string uncompFilename, string bmpFilename, int nGraphicWidth, int nGraphicHeight, int nOffset)
        {
            //const int INDEX_SIZE = 0x32;
            byte[] fileArray = File.ReadAllBytes(uncompFilename);

            byte[] positionArray = new byte[nOffset];
            for (int i = 0; i < positionArray.Length; i++)
            {
                positionArray[i] = fileArray[i];
            }

            int nForcedWidth = nGraphicWidth;
            int nForcedHeigh = nGraphicHeight;

            byte[] flameGraphic = new byte[nForcedWidth * nForcedHeigh];

            int byteIndex = 0;

            for (int bmpIndex = 0; bmpIndex < nForcedWidth * nForcedHeigh; bmpIndex += 2, byteIndex += 1)
            {
                flameGraphic[byteIndex] = fileArray[byteIndex + nOffset];
            }


            BitmapWriter.Write16BitmapFile(bmpFilename, nForcedWidth, nForcedHeigh, flameGraphic);
        }
Ejemplo n.º 2
0
        static void CreateScreen()
        {
            const int INDEX_SIZE = 0x32;

            byte[] fileArray = File.ReadAllBytes("C:\\games\\ultima_5\\temp\\dec_res\\create.16.uncomp");
            //byte[] fileArray = File.ReadAllBytes("C:\\games\\ultima_5\\temp\\dec_res\\create.16.uncomp");

            byte[] positionArray = new byte[INDEX_SIZE];
            for (int i = 0; i < positionArray.Length; i++)
            {
                positionArray[i] = fileArray[i];
            }

            int nForcedWidth = 168;// * 2;
            int nForcedHeigh = 200;

            byte[] flameGraphic = new byte[nForcedWidth * nForcedHeigh];//positionArray[2] * positionArray[3]];

            int byteIndex = 0;

            for (int bmpIndex = 0; byteIndex < nForcedWidth * nForcedHeigh; bmpIndex += 2, byteIndex += 1)
            {
                flameGraphic[byteIndex] = fileArray[byteIndex + INDEX_SIZE];
            }


            BitmapWriter.Write16BitmapFile("C:\\games\\ultima_5\\temp\\dec_res\\create.16.bmp", nForcedWidth, nForcedHeigh, flameGraphic);
            //positionArray[2], positionArray[3], fileArray);
        }