private bool DeserializeNormalizedRectangle(string normalizedRectangleString, out RectangleF normalizedRectangle) { normalizedRectangle = new RectangleF(); string[] rectangleComponents = normalizedRectangleString.Split('\\'); if (rectangleComponents.Length != 4) { return(false); } float left, right, top, bottom; if (!float.TryParse(rectangleComponents[0], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out left)) { return(false); } if (!float.TryParse(rectangleComponents[1], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out top)) { return(false); } if (!float.TryParse(rectangleComponents[2], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out right)) { return(false); } if (!float.TryParse(rectangleComponents[3], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out bottom)) { return(false); } if (left >= right) { return(false); } if (top >= bottom) { return(false); } if (left < 0F || left > 1.0F) { return(false); } if (top < 0F || top > 1.0F) { return(false); } if (right < 0F || right > 1.0F) { return(false); } if (bottom < 0F || bottom > 1.0F) { return(false); } normalizedRectangle = RectangleF.FromLTRB(left, top, right, bottom); return(RectangleUtilities.IsRectangleNormalized(normalizedRectangle)); }