public void SaveGallery() { List <Material_> materials = new List <Material_>(); foreach (Surface material in Items) { materials.Add(material.Material); // TODO zapisać ikonę } Material_.SaveMaterials(materials, "../../galleries/MaterialsGallery.txt"); // TODO poprawić ścieżkę w finalnej wersji }
public Surface SaveToGallery(Material_ material) { #if FINAL Surface surface = new Surface(material, AppDomain.CurrentDomain.BaseDirectory + "\\galleries\\materials\\" + material.Name + ".png"); List <Material_> mat = new List <Material_>() { material }; Material_.SaveMaterials(mat, AppDomain.CurrentDomain.BaseDirectory + "/galleries/materials/" + material.Name + ".mat"); #else Surface surface = new Surface(material, AppDomain.CurrentDomain.BaseDirectory + "..\\..\\galleries\\materials\\" + material.Name + ".png"); List <Material_> mat = new List <Material_>() { material }; Material_.SaveMaterials(mat, "../../galleries/materials/" + material.Name + ".mat"); #endif Modeler.Graphics.SurfaceRaytracer.SaveImage(material.Name, surface.ImageUri); return(surface); }