コード例 #1
0
        public static Worldfile TryReadAssociatedWorldfile(string imageFileName)
        {
            var worldFileName = TryGetAssociatedWorldfileName(imageFileName);

            if (worldFileName != null)
            {
                return(Worldfile.Read(worldFileName));
            }

            return(null);
        }
コード例 #2
0
        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());
        }