Ejemplo n.º 1
0
 public SPREditorVM(PersonaEditorLib.FileStructure.SPR.SPR spr)
 {
     for (int i = 0; i < spr.SubFiles.Count; i++)
     {
         TextureList.Add(new TextureVM(spr.SubFiles[i], spr.KeyList.List, i));
     }
 }
Ejemplo n.º 2
0
        private void Open(string filename)
        {
            Names.Clear();
            Images.Clear();
            SPR = new PersonaEditorLib.FileStructure.SPR.SPR(filename, true);

            List <PersonaEditorLib.FileStructure.TMX.TMX> list = SPR.GetTextureList();

            for (int i = 0; i < list.Count; i++)
            {
                var img = list[i];
                Names.Add(img.TMXname);
                var image = img.Image;

                var temp = new DrawingImage(new DrawingGroup());

                ImageDrawing ID = new ImageDrawing(image, new Rect(new Size(image.Width, image.Height)));
                (temp.Drawing as DrawingGroup).Children.Add(ID);
                (temp.Drawing as DrawingGroup).ClipGeometry = new RectangleGeometry(ID.Rect);

                Images.Add(new DRAW(SPR.KeyList.List.Where(x => x.mTextureIndex == i).ToList(), temp));
            }
        }