Пример #1
0
        public static DmiEX FromDmi(Dmi dmi)
        {
            DmiEX dmiEx = new DmiEX(dmi.Version, dmi.Width, dmi.Height);

            foreach (var state in dmi.States)
            {
                dmiEx.AddState(DmiEXState.FromDmiState(dmiEx, state));
            }

            return(dmiEx);
        }
Пример #2
0
        public object Clone()
        {
            DmiEX newDmiex = new DmiEX(Version, Width, Height);

            foreach (var state in States)
            {
                DmiEXState dmiExState = (DmiEXState)state;
                newDmiex.AddState((DmiEXState)dmiExState.Clone());
            }
            return(newDmiex);
        }
Пример #3
0
        public static DmiEXState FromDmiState(DmiEX parent, DMIState dmiState)
        {
            RawDmiState raw = dmiState.ToRaw();

            DmiEXImage[,] images = new DmiEXImage[(int)raw.Dirs.Value, raw.Frames.Value];
            for (int dir = 0; dir < (int)raw.Dirs.Value; dir++)
            {
                for (int frame = 0; frame < raw.Frames.Value; frame++)
                {
                    images[dir, frame] = new DmiEXImage(dmiState.GetBitmap(dir, frame));
                }
            }

            return(new DmiEXState(parent, images, raw));
        }