public static Worldfile TryReadAssociatedWorldfile(string imageFileName) { var worldFileName = TryGetAssociatedWorldfileName(imageFileName); if (worldFileName != null) { return(Worldfile.Read(worldFileName)); } return(null); }
public static void SaveWorldFile(string fileName, Worldfile worldfile) { StringBuilder lines = new StringBuilder(); lines.AppendLine(worldfile.XPixelSize.ToString()); lines.AppendLine(worldfile.YRotation.ToString()); lines.AppendLine(worldfile.XRotation.ToString()); lines.AppendLine((-worldfile.YPixelSize).ToString()); lines.AppendLine(worldfile.CenterOfUpperLeftPixel.X.ToString()); lines.AppendLine(worldfile.CenterOfUpperLeftPixel.Y.ToString()); System.IO.File.WriteAllText(fileName, lines.ToString()); }