public void Save(string fileName, ScreenshotHelper ssh) { if (string.IsNullOrEmpty(fileName)) { return; } if (ssh.shotInfo.Count <= 0) { var tempDelegate = ssh.DefaultsSet; ssh.DefaultsSet = null; ssh.SetDefaults(); ssh.DefaultsSet = tempDelegate; } sizes = ssh.shotInfo; orientation = ssh.orientation; lastSavePath = ssh.savePath; buildPathRoot = ssh.buildSavePathRoot; buildPathExtra = ssh.buildSavePathExtra; textureFormat = ssh.SSHTextureFormat; var serializer = new XmlSerializer(typeof(SSHPreset)); using (var stream = new FileStream(fileName, FileMode.Create)) serializer.Serialize(stream, this); }
public void SetDefaults() { orientation = SSHOrientation.portrait; openFolderWhenDone = true; shotInfo.Clear(); shotInfo.Add(new ShotSize(640, 960)); // iPhone 4 - 3.5" retina shotInfo.Add(new ShotSize(640, 1136)); // iPhone 5S and SE - 4" retina shotInfo.Add(new ShotSize(750, 1334)); // iPhone 6, 7, and 8 - 4.7" retina shotInfo.Add(new ShotSize(946, 2048)); // iPhone X - 5.8" retina shotInfo.Add(new ShotSize(1080, 1920)); // Nexus 5 / Pixel 2, iPhone 7, 7, and 8 PLUS (5.5") shotInfo.Add(new ShotSize(1080, 2160)); // Pixel 3 shotInfo.Add(new ShotSize(1440, 2880)); // Pixel 2 XL shotInfo.Add(new ShotSize(1440, 2960)); // Pixel 3 XL shotInfo.Add(new ShotSize(1600, 2560)); // Galaxy Tab Pro shotInfo.Add(new ShotSize(1200, 1920)); // Nexus 7 shotInfo.Add(new ShotSize(1242, 2208)); // iPhone 6 Plus - 5.5" retina shotInfo.Add(new ShotSize(1536, 2048)); // iPad 3 / 4 (OK for iPad mini) shotInfo.Add(new ShotSize(1125, 2436)); // 5.8" super retina shotInfo.Add(new ShotSize(2048, 2732)); // iPad Pro - 12.9" retina shotInfo.Add(new ShotSize(1668, 2224)); // 10.5" retina shotInfo.Add(new ShotSize(1496, 2048)); // 9.7" retina shotInfo = shotInfo.OrderBy(shot => shot.width).ToList(); savePath = ""; buildSavePathExtra = "screenshots"; buildSavePathRoot = Environment.SpecialFolder.MyPictures; if (DefaultsSet != null) { DefaultsSet(); } }
public void SetDefaults() { keyToHold = KeyCode.LeftShift; keyToPress = KeyCode.S; orientation = SSHOrientation.portrait; shotInfo.Clear(); shotInfo.Add(new ShotSize(640, 960)); // iPhone 4 shotInfo.Add(new ShotSize(640, 1136)); // iPhone 5 shotInfo.Add(new ShotSize(750, 1334)); // iPhone 6 shotInfo.Add(new ShotSize(1080, 1920)); // Nexus 5 shotInfo.Add(new ShotSize(1600, 2560)); // Galaxy Tab Pro shotInfo.Add(new ShotSize(1200, 1920)); // Nexus 7 shotInfo.Add(new ShotSize(1242, 2208)); // iPhone 6 Plus shotInfo.Add(new ShotSize(1536, 2048)); // iPad 3 / 4 (OK for iPad mini) shotInfo.Add(new ShotSize(2048, 2732)); // iPad Pro savePath = ""; buildSavePathExtra = "screenshots"; buildSavePathRoot = Environment.SpecialFolder.MyPictures; if (DefaultsSet != null) { DefaultsSet(); } }