Exemple #1
0
        static void testAni()
        {
            AniFile file;

            using (var f = File.OpenRead(path))
                file = new AniFile(f);

            Console.WriteLine(file);

            CursorTexture texture;

            using (var f = File.OpenRead(path))
                texture = file.load(null, f, null);
        }
Exemple #2
0
        static CursorTexture loadAnimated(this IRenderDevice device, string resource, int idealSize)
        {
            using (var stm = openResource(resource))
            {
                AniFile file;
                using (var unzip = new GZipStream(stm, CompressionMode.Decompress, true))
                    file = new AniFile(unzip);

                int index = file.formats.minIndex(ii => Math.Abs(ii.size.cx - idealSize));

                stm.rewind();
                using (var unzip = new GZipStream(stm, CompressionMode.Decompress))
                    return(file.load(device, unzip, "Busy cursor", index));
            }
        }