From 6363923fa0fc462c1730a093660ffb703daf8246 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Fri, 9 Dec 2022 21:08:24 +0100 Subject: [PATCH] Code formatting --- MapControl/WPF/GeoImage.WPF.cs | 16 +++++++++++----- MapControl/WinUI/GeoImage.WinUI.cs | 9 ++++++--- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/MapControl/WPF/GeoImage.WPF.cs b/MapControl/WPF/GeoImage.WPF.cs index 2b490423..362247a5 100644 --- a/MapControl/WPF/GeoImage.WPF.cs +++ b/MapControl/WPF/GeoImage.WPF.cs @@ -28,14 +28,19 @@ namespace MapControl var metadata = (BitmapMetadata)bitmap.Metadata; - if (metadata.GetQuery(QueryString(ModelPixelScaleTag)) is double[] pixelScale && pixelScale.Length == 3 && - metadata.GetQuery(QueryString(ModelTiePointTag)) is double[] tiePoint && tiePoint.Length >= 6) + if (metadata.GetQuery(QueryString(ModelPixelScaleTag)) is double[] pixelScale && + pixelScale.Length == 3 && + metadata.GetQuery(QueryString(ModelTiePointTag)) is double[] tiePoint && + tiePoint.Length >= 6) { transform = new Matrix(pixelScale[0], 0d, 0d, -pixelScale[1], tiePoint[3], tiePoint[4]); } - else if (metadata.GetQuery(QueryString(ModelTransformationTag)) is double[] tform && tform.Length == 16) + else if (metadata.GetQuery(QueryString(ModelTransformationTag)) is double[] transformValues && + transformValues.Length == 16) { - transform = new Matrix(tform[0], tform[1], tform[4], tform[5], tform[3], tform[7]); + transform = new Matrix(transformValues[0], transformValues[1], + transformValues[4], transformValues[5], + transformValues[3], transformValues[7]); } else { @@ -47,7 +52,8 @@ namespace MapControl projection = GetProjection(sourcePath, geoKeyDirectory); } - if (metadata.GetQuery(QueryString(NoDataTag)) is string noData && int.TryParse(noData, out int noDataValue)) + if (metadata.GetQuery(QueryString(NoDataTag)) is string noData && + int.TryParse(noData, out int noDataValue)) { bitmap = ConvertTransparentPixel(bitmap, noDataValue); } diff --git a/MapControl/WinUI/GeoImage.WinUI.cs b/MapControl/WinUI/GeoImage.WinUI.cs index f687f999..12757c2d 100644 --- a/MapControl/WinUI/GeoImage.WinUI.cs +++ b/MapControl/WinUI/GeoImage.WinUI.cs @@ -48,14 +48,17 @@ namespace MapControl }); if (metadata.TryGetValue(pixelScaleQuery, out BitmapTypedValue pixelScaleValue) && - pixelScaleValue.Value is double[] pixelScale && pixelScale.Length == 3 && + pixelScaleValue.Value is double[] pixelScale && + pixelScale.Length == 3 && metadata.TryGetValue(tiePointQuery, out BitmapTypedValue tiePointValue) && - tiePointValue.Value is double[] tiePoint && tiePoint.Length >= 6) + tiePointValue.Value is double[] tiePoint && + tiePoint.Length >= 6) { transform = new Matrix(pixelScale[0], 0d, 0d, -pixelScale[1], tiePoint[3], tiePoint[4]); } else if (metadata.TryGetValue(transformationQuery, out BitmapTypedValue transformValue) && - transformValue.Value is double[] transformValues && transformValues.Length == 16) + transformValue.Value is double[] transformValues && + transformValues.Length == 16) { transform = new Matrix(transformValues[0], transformValues[1], transformValues[4], transformValues[5],