public static void Export(string path, DistortionParameters parameters, Size imageSize)
        {
            XmlWriterSettings settings = new XmlWriterSettings();

            settings.Indent      = true;
            settings.CloseOutput = true;

            using (XmlWriter w = XmlWriter.Create(path, settings))
            {
                DistortionSerializer.Serialize(w, parameters, true, imageSize);
            }
        }
Esempio n. 2
0
        public void WriteXml(XmlWriter w)
        {
            if (calibratorType == CalibratorType.Line)
            {
                w.WriteStartElement("CalibrationLine");
                calibrationLine.WriteXml(w);
                w.WriteEndElement();
            }
            else if (calibratorType == CalibratorType.Plane)
            {
                w.WriteStartElement("CalibrationPlane");
                calibrationPlane.WriteXml(w);
                w.WriteEndElement();
            }

            w.WriteStartElement("Unit");
            w.WriteAttributeString("Abbreviation", GetLengthAbbreviation());
            w.WriteString(lengthUnit.ToString());
            w.WriteEndElement();

            DistortionSerializer.Serialize(w, distortionHelper.Parameters, false, imageSize);
        }