From bf94f1674ef83b92a84ce3e80fee0a2be6f26adb Mon Sep 17 00:00:00 2001 From: tsuji Date: Thu, 25 Nov 2021 15:08:50 +0900 Subject: [PATCH] =?UTF-8?q?TIFF=E5=87=BA=E5=8A=9B=E3=83=91=E3=83=A9?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=82=BF=E3=81=A8=E6=A4=9C=E7=89=88=E3=83=91?= =?UTF-8?q?=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E3=81=AE=E5=89=8D=E5=9B=9E?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E5=80=A4=E3=82=92=E5=88=9D=E6=9C=9F=E5=80=A4?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E6=94=B9=E8=89=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Code/CSRender/CSRender/App.config | 27 +++++ Code/CSRender/CSRender/MainWindow.xaml.cs | 21 ++++ .../CSRender/Properties/Settings.Designer.cs | 102 +++++++++++++++--- .../CSRender/Properties/Settings.settings | 27 ++++- 4 files changed, 155 insertions(+), 22 deletions(-) diff --git a/Code/CSRender/CSRender/App.config b/Code/CSRender/CSRender/App.config index 00bfd11..6061b33 100644 --- a/Code/CSRender/CSRender/App.config +++ b/Code/CSRender/CSRender/App.config @@ -1,6 +1,33 @@  + + +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Code/CSRender/CSRender/MainWindow.xaml.cs b/Code/CSRender/CSRender/MainWindow.xaml.cs index b99c6aa..0a6b56e 100644 --- a/Code/CSRender/CSRender/MainWindow.xaml.cs +++ b/Code/CSRender/CSRender/MainWindow.xaml.cs @@ -89,6 +89,14 @@ namespace CSRender FilePattern.Add((new ComboBoxSet { Id = 7, Item = "BMP" })); FileSelect.ItemsSource = FilePattern; + //デフォルトに前回の設定値を表示 + ResolutionBox.Text = Properties.Settings.Default.resolutionSetting; + FileSelect.Text = Properties.Settings.Default.formatSetting; + PositionBox.Text = Properties.Settings.Default.shiftPixelSetting; + GradationBox.Text = Properties.Settings.Default.colorMarginSetting; + SmallDiffBox.Text = Properties.Settings.Default.removePointSetting; + VisualBox.Text = Properties.Settings.Default.shadingOffSetting; + //ドラッグ&ドロップイベントの追加 targetBox.AddHandler(TextBox.DragOverEvent, new DragEventHandler(textBox_PreviewDragOver), true); targetBox.AddHandler(TextBox.DropEvent, new DragEventHandler(TargetBox_Drop), true); @@ -185,6 +193,14 @@ namespace CSRender //指定先にレポートを移動 CompareTIFF.moveReport(workBox.Text, workDir); + //パラメータを次回初期値用に保存 + Properties.Settings.Default.resolutionSetting = ResolutionBox.Text; + Properties.Settings.Default.formatSetting = FileSelect.Text; + Properties.Settings.Default.shiftPixelSetting = PositionBox.Text; + Properties.Settings.Default.colorMarginSetting = GradationBox.Text; + Properties.Settings.Default.removePointSetting = SmallDiffBox.Text; + Properties.Settings.Default.shadingOffSetting = VisualBox.Text; + Properties.Settings.Default.Save(); } //UIに検版結果を出力 @@ -254,6 +270,11 @@ namespace CSRender ResultConsole.Text += TIFFresult; ResultConsole.Text += "\r\n<変換終了>\r\n"; ResultConsole.ScrollToEnd(); + + //パラメータを次回初期値用に保存 + Properties.Settings.Default.resolutionSetting = ResolutionBox.Text; + Properties.Settings.Default.formatSetting = FileSelect.Text; + Properties.Settings.Default.Save(); } } diff --git a/Code/CSRender/CSRender/Properties/Settings.Designer.cs b/Code/CSRender/CSRender/Properties/Settings.Designer.cs index 20d4e86..a78a07f 100644 --- a/Code/CSRender/CSRender/Properties/Settings.Designer.cs +++ b/Code/CSRender/CSRender/Properties/Settings.Designer.cs @@ -1,30 +1,98 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// このコードはツールによって生成されました。 +// ランタイム バージョン:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 +// コードが再生成されるときに損失したりします。 // //------------------------------------------------------------------------------ -namespace CSRender.Properties -{ - - +namespace CSRender.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string resolutionSetting { + get { + return ((string)(this["resolutionSetting"])); + } + set { + this["resolutionSetting"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string formatSetting { + get { + return ((string)(this["formatSetting"])); + } + set { + this["formatSetting"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string shiftPixelSetting { + get { + return ((string)(this["shiftPixelSetting"])); + } + set { + this["shiftPixelSetting"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string colorMarginSetting { + get { + return ((string)(this["colorMarginSetting"])); + } + set { + this["colorMarginSetting"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string removePointSetting { + get { + return ((string)(this["removePointSetting"])); + } + set { + this["removePointSetting"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string shadingOffSetting { + get { + return ((string)(this["shadingOffSetting"])); + } + set { + this["shadingOffSetting"] = value; + } + } } } diff --git a/Code/CSRender/CSRender/Properties/Settings.settings b/Code/CSRender/CSRender/Properties/Settings.settings index 8f2fd95..f294576 100644 --- a/Code/CSRender/CSRender/Properties/Settings.settings +++ b/Code/CSRender/CSRender/Properties/Settings.settings @@ -1,7 +1,24 @@  - - - - - + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- 2.22.0