From 6e9376fc933c8721cdf90e68ccf4457090af968d Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 09 十一月 2022 10:35:21 +0800 Subject: [PATCH] 1 --- ExportMap/Models/ExportArgs.cs | 38 +++++++++++++++++++++++++++++++++++++- 1 files changed, 37 insertions(+), 1 deletions(-) diff --git a/ExportMap/Models/ExportArgs.cs b/ExportMap/Models/ExportArgs.cs index 09532eb..fc67e59 100644 --- a/ExportMap/Models/ExportArgs.cs +++ b/ExportMap/Models/ExportArgs.cs @@ -18,6 +18,11 @@ public String title { set; get; } /// <summary> + /// 绾稿紶澶у皬 + /// </summary> + public string pageSize { set; get; } + + /// <summary> /// 鐪佷唤 /// </summary> public String province { set; get; } @@ -28,7 +33,7 @@ public String scale { set; get; } /// <summary> - /// 鍒嗚鲸鐜� + /// 鍒嗚鲸鐜囷紙鍙充笅瑙掓枃鏈級 /// </summary> public String resolution { set; get; } @@ -72,6 +77,11 @@ /// </summary> public double xmax { set; get; } + /// <summary> + /// 鍑哄浘鍒嗚鲸鐜� + /// </summary> + public int dpi { set; get; } + public void SetDefault() { if (string.IsNullOrWhiteSpace(title)) title = "绠¢亾鍩虹澶ф暟鎹钩鍙�"; @@ -80,7 +90,33 @@ if (string.IsNullOrWhiteSpace(resolution)) resolution = string.Empty; if (string.IsNullOrWhiteSpace(date)) date = DateTime.Now.ToString("yyyy.MM.dd"); + this.dpi = GetDpi(this.pageSize); imgPath = ""; } + + public int GetDpi(string page) + { + if (string.IsNullOrWhiteSpace(page)) return 300; + + switch (page.ToUpper()) + { + case "A0": + return 1200; + case "A1": + return 850; + case "A2": + return 600; + case "A3": + return 424; + case "A4": + return 300; + case "A5": + return 212; + case "A6": + return 150; + default: + return 300; + } + } } } -- Gitblit v1.9.3