Exemplo n.º 1
0
        public override DMIState AddNewState(string name)
        {
            RawDmiState raw = RawDmiState.Default(name);

            DmiEXImage[,] images = new DmiEXImage[1, 1];
            images[0, 0]         = (DmiEXImage)CreateEmptyImage();

            DmiEXState dmiState = new DmiEXState(this, images, raw);

            return(AddState(dmiState));
        }
Exemplo n.º 2
0
        public object Clone()
        {
            DmiEXImage image = new DmiEXImage(Width, Height)
            {
                _layers = new List <DmiEXLayer>()
            };

            foreach (var layer in _layers)
            {
                image.AddLayer((DmiEXLayer)layer.Clone());
            }

            return(image);
        }
Exemplo n.º 3
0
        public object Clone()
        {
            RawDmiState raw = 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] = (DmiEXImage)_images[dir, frame].Clone();
                }
            }
            return(new DmiEXState(Parent, images, raw));
        }
Exemplo n.º 4
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));
        }