绘图形状补充一部分

This commit is contained in:
艾竹
2023-05-14 15:06:30 +08:00
parent 9ade5a0fda
commit 58359c36d4
22 changed files with 1013 additions and 42 deletions

View File

@@ -634,6 +634,17 @@ namespace AIStudio.Wpf.DiagramDesigner
return value;
}
public static string SerializeMatrix(Matrix matrix)
{
return string.Format("{0},{1},{2},{3},{4},{5}", matrix.M11, matrix.M12, matrix.M21, matrix.M22, matrix.OffsetX, matrix.OffsetY); ;
}
public static Matrix DeserializeMatrix(string matrix)
{
string[] pieces = matrix.Split(new char[] { ',' });
return new Matrix(double.Parse(pieces[0]), double.Parse(pieces[1]), double.Parse(pieces[2]), double.Parse(pieces[3]), double.Parse(pieces[4]), double.Parse(pieces[5]));
}
public static string SerializeObject(object obj, string serializableType = null)
{
if (serializableType?.ToLower() == ".xml")