diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f7d32d..b7d3345 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,5 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added feature by issue.([Issue #1](https://github.com/overdrive1708/PhotoFrameGenerator/issues/1)) +- Added feature by issue.([Issue #2](https://github.com/overdrive1708/PhotoFrameGenerator/issues/2)) [Unreleased]: https://github.com/overdrive1708/PhotoFrameGenerator diff --git a/NOTICE.md b/NOTICE.md index cbd0f17..683ea3f 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -1,3 +1,311 @@ # NOTICES AND INFORMATION This software incorporates materail from third parties. + +## CommunityToolkit.Mvvm + +Source: https://github.com/CommunityToolkit/dotnet + +### License + +```txt +# .NET Community Toolkit + +Copyright © .NET Foundation and Contributors + +All rights reserved. + +## MIT License (MIT) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +``` + +## MetadataExtractor + +Source: https://github.com/drewnoakes/metadata-extractor-dotnet + +### License + +```txt + Copyright 2002-2019 Drew Noakes and contributors + 2014 Imazen LLC (initial conversion from Java to C#) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this code except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------------------------------------------------------------------ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +------------------------------------------------------------------------------ + +MetadataExtractor depends upon the following 3rd party packages with their own +license terms: + +- XmpCore (runtime) licensed under BSD + +- xUnit (design time) licensed under Apache 2.0 +``` + +## Microsoft.Xaml.Behaviors.Wpf + +Source: https://github.com/Microsoft/XamlBehaviorsWpf + +### License + +```txt +The MIT License (MIT) + +Copyright (c) 2015 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` + +## ModernWpfUI + +Source: https://github.com/Kinnara/ModernWpf + +### License + +```txt +MIT License + +Copyright (c) 2019 Yimeng Wu + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` + +## SkiaSharp + +Source: https://github.com/mono/SkiaSharp + +### License + +```txt +Copyright (c) 2015-2016 Xamarin, Inc. +Copyright (c) 2017-2018 Microsoft Corporation. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +``` diff --git a/README.md b/README.md index 32f2006..2ea460a 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,19 @@ ## アプリケーション概要 撮影時の情報を写真の周りに埋め込むアプリケーションです。 +加工後のサンプル画像 + +加工後のサンプル画像 + ## ダウンロード方法 [GitHubのReleases](https://github.com/overdrive1708/PhotoFrameGenerator/releases)にあるLatestのAssetsよりPhotoFrameGenerator_Ver.x.x.x.zipをダウンロードしてください。 ## 使い方 -T.B.D. +1. PhotoFrameGenerator.exeを実行します。 +1. 加工したい画像ファイル(JPEG形式)を「入力ファイル追加」にドラッグ&ドロップします。 +1. 表示させたいEXIF情報を選んで「生成」をクリックします。 +1. 下部ステータスバーに「生成が完了しました。」と表示されたら完了です。 +1. 加工したい画像ファイルと同じ場所に「framed-」が頭についたファイルが出来上がります。 ## 開発環境 Visual Studio 2026 Community diff --git a/asetts/ApplicationIcon.ico b/asetts/ApplicationIcon.ico index b56420d..a8de216 100644 Binary files a/asetts/ApplicationIcon.ico and b/asetts/ApplicationIcon.ico differ diff --git a/asetts/ApplicationIcon.png b/asetts/ApplicationIcon.png index 50c98e2..0663f46 100644 Binary files a/asetts/ApplicationIcon.png and b/asetts/ApplicationIcon.png differ diff --git a/asetts/sample.JPG b/asetts/sample.JPG new file mode 100644 index 0000000..e130770 Binary files /dev/null and b/asetts/sample.JPG differ diff --git a/src/PhotoFrameGenerator/App.xaml b/src/PhotoFrameGenerator/App.xaml index d2b6c96..c145e72 100644 --- a/src/PhotoFrameGenerator/App.xaml +++ b/src/PhotoFrameGenerator/App.xaml @@ -2,6 +2,14 @@ x:Class="PhotoFrameGenerator.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - StartupUri="Views/MainWindow.xaml"> - + xmlns:ui="http://schemas.modernwpf.com/2019" + Startup="Application_Startup"> + + + + + + + + diff --git a/src/PhotoFrameGenerator/App.xaml.cs b/src/PhotoFrameGenerator/App.xaml.cs index e97d409..5d23be8 100644 --- a/src/PhotoFrameGenerator/App.xaml.cs +++ b/src/PhotoFrameGenerator/App.xaml.cs @@ -1,4 +1,5 @@ -using System.Windows; +using PhotoFrameGenerator.Models; +using System.Windows; namespace PhotoFrameGenerator { @@ -7,6 +8,22 @@ namespace PhotoFrameGenerator /// public partial class App : Application { + /// + /// Startup処理 + /// + /// イベントソース + /// イベントデータ + private void Application_Startup(object sender, StartupEventArgs e) + { + // 未処理の例外が発生したときの処理を登録する。 + DispatcherUnhandledException += ExceptionHandler.OnDispatcherUnhandledException; + TaskScheduler.UnobservedTaskException += ExceptionHandler.OnUnobservedTaskException; + AppDomain.CurrentDomain.UnhandledException += ExceptionHandler.OnUnhandledException; + + // MainWindowを表示する。 + MainWindow mainWindow = new(); + mainWindow.Show(); + } } } diff --git a/src/PhotoFrameGenerator/Models/ExceptionHandler.cs b/src/PhotoFrameGenerator/Models/ExceptionHandler.cs new file mode 100644 index 0000000..1922cc0 --- /dev/null +++ b/src/PhotoFrameGenerator/Models/ExceptionHandler.cs @@ -0,0 +1,85 @@ +using System.Diagnostics; +using System.IO; +using System.Windows; +using System.Windows.Threading; + +namespace PhotoFrameGenerator.Models +{ + /// + /// 例外ハンドラークラス + /// + public class ExceptionHandler + { + //-------------------------------------------------- + // 定数 + //-------------------------------------------------- + /// + /// 例外情報記録ファイル + /// + private const string FatalErrorInformationPath = @"FatalErrorInformation.log"; + + /// + /// メモ帳の実行ファイル + /// + private const string NotepadPath = "notepad.exe"; + + //-------------------------------------------------- + // メソッド + //-------------------------------------------------- + /// + /// DispatcherUnhandledExceptionイベント発生時の処理 + /// + /// イベントソース + /// イベントデータ + public static void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) => HandleException(e.Exception); + + /// + /// UnobservedTaskExceptionイベント発生時の処理 + /// + /// イベントソース + /// イベントデータ + public static void OnUnobservedTaskException(object ?sender, UnobservedTaskExceptionEventArgs e) + { + if (e.Exception.InnerException != null) + { + HandleException(e.Exception.InnerException); + } + } + + /// + /// UnhandledExceptionイベント発生時の処理 + /// + /// イベントソース + /// イベントデータ + public static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) => HandleException((Exception)e.ExceptionObject); + + /// + /// 例外発生時の処理 + /// + /// 例外情報 + private static void HandleException(Exception exception) + { + // 例外の詳細情報をファイルに出力する。 + using (StreamWriter fatalErrorInformationFile = new(FatalErrorInformationPath, false, System.Text.Encoding.UTF8)) + { + fatalErrorInformationFile.Write(exception.ToString()); + fatalErrorInformationFile.Close(); + } + + // 例外の詳細情報を表示するか確認する。 + MessageBoxResult result = MessageBox.Show(Resources.Strings.MessageFatalError, + Resources.Strings.ImportantNotice, + MessageBoxButton.YesNo, + MessageBoxImage.Error); + + // 例外の詳細情報を表示する場合、ファイルに出力してメモ帳で開く。 + if (result == MessageBoxResult.Yes) + { + _ = Process.Start(NotepadPath, FatalErrorInformationPath); + } + + // 終了する。 + Environment.Exit(1); + } + } +} diff --git a/src/PhotoFrameGenerator/Models/ImageHelper.cs b/src/PhotoFrameGenerator/Models/ImageHelper.cs new file mode 100644 index 0000000..c3d2ac5 --- /dev/null +++ b/src/PhotoFrameGenerator/Models/ImageHelper.cs @@ -0,0 +1,324 @@ +using MetadataExtractor; +using MetadataExtractor.Formats.Exif; +using SkiaSharp; +using System.Globalization; +using System.IO; + +namespace PhotoFrameGenerator.Models +{ + /// + /// 画像関連ヘルパークラス + /// + public class ImageHelper + { + /// + /// フレームマージン(左) + /// + private const int FrameLeftMargin = 150; + + /// + /// フレームマージン(右) + /// + private const int FrameRightMargin = 150; + + /// + /// フレームマージン(上) + /// + private const int FrameTopMargin = 150; + + /// + /// フレームマージン(下の画像に対する割合) + /// + private const float FrameBottomMarginRatio = 0.15f; + + /// + /// 枠の線幅 + /// + private const int BorderStrokeWidth = 1; + + /// + /// 1行目のフォントサイズ(下のフレームに対する割合) + /// + private const float Line1FontSizeRatio = 0.18f; + + /// + /// 2行目のフォントサイズ(下のフレームに対する割合) + /// + private const float Line2FontSizeRatio = 0.16f; + + /// + /// 3行目のフォントサイズ(下のフレームに対する割合) + /// + private const float Line3FontSizeRatio = 0.14f; + + /// + /// テキスト間隔 + /// + private const int LineSpace = 30; + + /// + /// エンコード品質 + /// + private const int EncodeQuality = 95; + + /// + /// フレーム表示設定クラス + /// + public class FrameDisplaySettings + { + /// + /// 表示有無(カメラ名) + /// + public bool IsDisplayCameraModel { get; set; } = false; + + /// + /// 表示有無(レンズ名) + /// + public bool IsDisplayLensModel { get; set; } = false; + + /// + /// 表示有無(焦点距離) + /// + public bool IsDisplayFocalLength { get; set; } = false; + + /// + /// 表示有無(露出モード) + /// + public bool IsDisplayExposureMode { get; set; } = false; + + /// + /// 表示有無(絞り) + /// + public bool IsDisplayAperture { get; set; } = false; + + /// + /// 表示有無(シャッタースピード) + /// + public bool IsDisplayShutterSpeed { get; set; } = false; + + /// + /// 表示有無(露出補正) + /// + public bool IsDisplayExposureCompensation { get; set; } = false; + + /// + /// 表示有無(ISO感度) + /// + public bool IsDisplayISOSensitivity { get; set; } = false; + + /// + /// 表示有無(撮影日時) + /// + public bool IsDisplayShootingDateAndTime { get; set; } = false; + } + + /// + /// JPEG判定処理 + /// + /// ファイルのフルパス + /// true:JPEG形式、false:その他の形式 + public static bool IsJpeg(string filePath) + { + if (string.IsNullOrWhiteSpace(filePath) || !File.Exists(filePath)) + { + return false; + } + + try + { + using FileStream fs = new(filePath, FileMode.Open, FileAccess.Read, FileShare.Read); + if (fs.Length < 2) + { + return false; + } + + // 先頭2バイトを読み込む + byte[] buffer = new byte[2]; + fs.ReadExactly(buffer, 0, 2); + + // JPEGの開始マーカー (SOI): 0xFF, 0xD8 + return buffer[0] == 0xFF && buffer[1] == 0xD8; + } + catch (Exception) + { + // ファイルアクセス権限エラーなどの場合 + return false; + } + } + + /// + /// フレーム付き画像生成処理 + /// + /// ファイルのフルパス + /// フレーム表示設定 + public static void GenerateFramedImage(string filePath, FrameDisplaySettings settings) + { + // EXIF情報の取得 + IEnumerable directories = ImageMetadataReader.ReadMetadata(filePath); + ExifIfd0Directory? ifd0Directory = directories.OfType().FirstOrDefault(); + ExifSubIfdDirectory? subIfdDirectory = directories.OfType().FirstOrDefault(); + string? model = ifd0Directory?.GetDescription(ExifDirectoryBase.TagModel); + string? lensModel = subIfdDirectory?.GetDescription(ExifDirectoryBase.TagLensModel); + string? focalLength = subIfdDirectory?.GetDescription(ExifDirectoryBase.TagFocalLength); + string? fnumber = subIfdDirectory?.GetDescription(ExifDirectoryBase.TagFNumber); + string? exposureTime = subIfdDirectory?.GetDescription(ExifDirectoryBase.TagExposureTime); + string? isospeedRatings = subIfdDirectory?.GetDescription(ExifDirectoryBase.TagIsoEquivalent); + string? exposureProgram = subIfdDirectory?.GetDescription(ExifDirectoryBase.TagExposureProgram); + string? exposurebiasValue = subIfdDirectory?.GetDescription(ExifDirectoryBase.TagExposureBias); + string? dateTimeOriginal = subIfdDirectory?.GetDescription(ExifDirectoryBase.TagDateTimeOriginal); + + // フレームに表示する文字列の生成 + string addLine1 = string.Empty; + if(settings.IsDisplayCameraModel && !string.IsNullOrEmpty(model)) + { + addLine1 += model; + } + string addLine2 = string.Empty; + if (settings.IsDisplayLensModel && !string.IsNullOrEmpty(lensModel)) + { + addLine2 += lensModel; + } + string addLine3 = string.Empty; + if(settings.IsDisplayFocalLength && !string.IsNullOrEmpty(focalLength)) + { + if (addLine3 != string.Empty) + { + addLine3 += " | "; + } + addLine3 += focalLength; + } + if(settings.IsDisplayExposureMode && !string.IsNullOrEmpty(exposureProgram)) + { + if (addLine3 != string.Empty) + { + addLine3 += " | "; + } + addLine3 += exposureProgram; + } + if(settings.IsDisplayAperture && !string.IsNullOrEmpty(fnumber)) + { + if (addLine3 != string.Empty) + { + addLine3 += " | "; + } + addLine3 += fnumber; + } + if(settings.IsDisplayShutterSpeed && !string.IsNullOrEmpty(exposureTime)) + { + if (addLine3 != string.Empty) + { + addLine3 += " | "; + } + addLine3 += exposureTime; + } + if(settings.IsDisplayExposureCompensation && !string.IsNullOrEmpty(exposurebiasValue)) + { + if (addLine3 != string.Empty) + { + addLine3 += " | "; + } + addLine3 += $"Exposure Compensation {exposurebiasValue}"; + } + if(settings.IsDisplayISOSensitivity && !string.IsNullOrEmpty(isospeedRatings)) + { + if (addLine3 != string.Empty) + { + addLine3 += " | "; + } + addLine3 += $"ISO {isospeedRatings}"; + } + if (settings.IsDisplayShootingDateAndTime && !string.IsNullOrEmpty(dateTimeOriginal)) + { + if (addLine3 != string.Empty) + { + addLine3 += " | "; + } + addLine3 += DateTime.ParseExact(dateTimeOriginal, "yyyy:MM:dd HH:mm:ss", CultureInfo.InvariantCulture).ToString("yyyy/MM/dd HH:mm:ss"); + } + + // 画像の読み込み + using SKBitmap inputBitmap = SKBitmap.Decode(filePath); + if (inputBitmap == null) + { + return; + } + + // キャンバスのサイズ計算 + int frameBottomMargin = (int)(inputBitmap.Height * FrameBottomMarginRatio); + int canvasWidth = inputBitmap.Width + FrameLeftMargin + FrameRightMargin; + int canvasHeight = inputBitmap.Height + FrameTopMargin + frameBottomMargin; + + // 新しいキャンバスの作成 + SKImageInfo newInfo = new(canvasWidth, canvasHeight); + using SKSurface surface = SKSurface.Create(newInfo); + SKCanvas canvas = surface.Canvas; + + // キャンバスを白で塗りつぶす + canvas.Clear(SKColors.White); + + // キャンバスの周りに枠を描画する + using SKPaint paintBorder = new() + { + Color = SKColors.DimGray, + IsAntialias = true, + Style = SKPaintStyle.Stroke, + StrokeWidth = BorderStrokeWidth + }; + canvas.DrawRect(0, 0, newInfo.Width, newInfo.Height, paintBorder); + + // 元画像を描画する + canvas.DrawBitmap(inputBitmap, FrameLeftMargin, FrameTopMargin); + + // テキストの描画設定(共通) + float centerX = newInfo.Width / 2f; + float marginCenterY = inputBitmap.Height + FrameTopMargin + (frameBottomMargin / 2f); + + // テキストの描画設定(1行目) + using SKTypeface typefaceLine1 = SKTypeface.FromFamilyName("Arial", SKFontStyle.Normal); + using SKFont fontLine1 = new(typefaceLine1, frameBottomMargin * Line1FontSizeRatio); + using SKPaint paintLine1 = new() + { + IsAntialias = true, + Color = SKColors.Black + }; + float y1 = marginCenterY - fontLine1.Size - ((fontLine1.Metrics.Ascent + fontLine1.Metrics.Descent) / 2f); + + // テキストの描画(1行目) + canvas.DrawText(addLine1, centerX, y1, SKTextAlign.Center, fontLine1, paintLine1); + + // テキストの描画設定(2行目) + using SKTypeface typefaceLine2 = SKTypeface.FromFamilyName("Arial", SKFontStyle.Normal); + using SKFont fontLine2 = new(typefaceLine2, frameBottomMargin * Line2FontSizeRatio); + using SKPaint paintLine2 = new() + { + IsAntialias = true, + Color = SKColors.Black + }; + float y2 = y1 + fontLine2.Size + LineSpace; + + // テキストの描画(2行目) + canvas.DrawText(addLine2, centerX, y2, SKTextAlign.Center, fontLine2, paintLine2); + + // テキストの描画設定(3行目) + using SKTypeface typefaceLine3 = SKTypeface.FromFamilyName("Arial", SKFontStyle.Normal); + using SKFont fontLine3 = new(typefaceLine3, frameBottomMargin * Line3FontSizeRatio); + using SKPaint paintLine3 = new() + { + IsAntialias = true, + Color = SKColors.DimGray + }; + float y3 = y2 + fontLine3.Size + LineSpace; + + // テキストの描画(3行目) + canvas.DrawText(addLine3, centerX, y3, SKTextAlign.Center, fontLine3, paintLine3); + + // 画像の保存 + string newFileName = $"framed-{Path.GetFileName(filePath)}"; + string newFilePath = Path.Combine(Path.GetDirectoryName(filePath) ?? System.IO.Directory.GetCurrentDirectory(), newFileName); + using SKImage image = surface.Snapshot(); + using SKData data = image.Encode(SKEncodedImageFormat.Jpeg, EncodeQuality); + using FileStream stream = File.OpenWrite(newFilePath); + data.SaveTo(stream); + } + } +} diff --git a/src/PhotoFrameGenerator/PhotoFrameGenerator.csproj b/src/PhotoFrameGenerator/PhotoFrameGenerator.csproj index a70fb25..cdaf99d 100644 --- a/src/PhotoFrameGenerator/PhotoFrameGenerator.csproj +++ b/src/PhotoFrameGenerator/PhotoFrameGenerator.csproj @@ -13,10 +13,38 @@ https://github.com/overdrive1708/PhotoFrameGenerator ja-JP false + Resources\ApplicationIcon.ico none + + + + + + + + + + + + + + + True + True + Strings.resx + + + + + + PublicResXFileCodeGenerator + Strings.Designer.cs + + + diff --git a/src/PhotoFrameGenerator/Resources/ApplicationIcon.ico b/src/PhotoFrameGenerator/Resources/ApplicationIcon.ico new file mode 100644 index 0000000..a8de216 Binary files /dev/null and b/src/PhotoFrameGenerator/Resources/ApplicationIcon.ico differ diff --git a/src/PhotoFrameGenerator/Resources/Strings.Designer.cs b/src/PhotoFrameGenerator/Resources/Strings.Designer.cs new file mode 100644 index 0000000..1a22665 --- /dev/null +++ b/src/PhotoFrameGenerator/Resources/Strings.Designer.cs @@ -0,0 +1,263 @@ +//------------------------------------------------------------------------------ +// +// このコードはツールによって生成されました。 +// ランタイム バージョン:4.0.30319.42000 +// +// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 +// コードが再生成されるときに損失したりします。 +// +//------------------------------------------------------------------------------ + +namespace PhotoFrameGenerator.Resources { + using System; + + + /// + /// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。 + /// + // このクラスは StronglyTypedResourceBuilder クラスが ResGen + // または Visual Studio のようなツールを使用して自動生成されました。 + // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に + // ResGen を実行し直すか、または VS プロジェクトをビルドし直します。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Strings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Strings() { + } + + /// + /// このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PhotoFrameGenerator.Resources.Strings", typeof(Strings).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// すべてについて、現在のスレッドの CurrentUICulture プロパティをオーバーライドします + /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// 入力ファイル追加 に類似しているローカライズされた文字列を検索します。 + /// + public static string AddInputFile { + get { + return ResourceManager.GetString("AddInputFile", resourceCulture); + } + } + + /// + /// 絞り に類似しているローカライズされた文字列を検索します。 + /// + public static string Aperture { + get { + return ResourceManager.GetString("Aperture", resourceCulture); + } + } + + /// + /// カメラ名 に類似しているローカライズされた文字列を検索します。 + /// + public static string CameraModel { + get { + return ResourceManager.GetString("CameraModel", resourceCulture); + } + } + + /// + /// クリア に類似しているローカライズされた文字列を検索します。 + /// + public static string Clear { + get { + return ResourceManager.GetString("Clear", resourceCulture); + } + } + + /// + /// 表示するEXIF情報 に類似しているローカライズされた文字列を検索します。 + /// + public static string EXIFInformationToDisplay { + get { + return ResourceManager.GetString("EXIFInformationToDisplay", resourceCulture); + } + } + + /// + /// 露出補正 に類似しているローカライズされた文字列を検索します。 + /// + public static string ExposureCompensation { + get { + return ResourceManager.GetString("ExposureCompensation", resourceCulture); + } + } + + /// + /// 露出モード に類似しているローカライズされた文字列を検索します。 + /// + public static string ExposureMode { + get { + return ResourceManager.GetString("ExposureMode", resourceCulture); + } + } + + /// + /// 焦点距離 に類似しているローカライズされた文字列を検索します。 + /// + public static string FocalLength { + get { + return ResourceManager.GetString("FocalLength", resourceCulture); + } + } + + /// + /// 生成 に類似しているローカライズされた文字列を検索します。 + /// + public static string Generate { + get { + return ResourceManager.GetString("Generate", resourceCulture); + } + } + + /// + /// 重要なお知らせ に類似しているローカライズされた文字列を検索します。 + /// + public static string ImportantNotice { + get { + return ResourceManager.GetString("ImportantNotice", resourceCulture); + } + } + + /// + /// 入力ファイル一覧 に類似しているローカライズされた文字列を検索します。 + /// + public static string InputFileList { + get { + return ResourceManager.GetString("InputFileList", resourceCulture); + } + } + + /// + /// ISO感度 に類似しているローカライズされた文字列を検索します。 + /// + public static string ISOSensitivity { + get { + return ResourceManager.GetString("ISOSensitivity", resourceCulture); + } + } + + /// + /// レンズ名 に類似しているローカライズされた文字列を検索します。 + /// + public static string LensModel { + get { + return ResourceManager.GetString("LensModel", resourceCulture); + } + } + + /// + /// 致命的なエラーが発生しました。 + ///このアプリケーションを終了します。 + ///エラーの詳細な情報を表示しますか? に類似しているローカライズされた文字列を検索します。 + /// + public static string MessageFatalError { + get { + return ResourceManager.GetString("MessageFatalError", resourceCulture); + } + } + + /// + /// ファイルもしくはファイルが含まれるフォルダをドラッグ&ドロップしてください。 に類似しているローカライズされた文字列を検索します。 + /// + public static string MessageGuideDragAndDrop { + get { + return ResourceManager.GetString("MessageGuideDragAndDrop", resourceCulture); + } + } + + /// + /// このアプリケーションのプロジェクトURLを開く に類似しているローカライズされた文字列を検索します。 + /// + public static string MessageOpenProjectUrl { + get { + return ResourceManager.GetString("MessageOpenProjectUrl", resourceCulture); + } + } + + /// + /// 準備が完了しました。「生成」ボタン押下で生成を行います。 に類似しているローカライズされた文字列を検索します。 + /// + public static string MessageStatusAlreadyGenerate { + get { + return ResourceManager.GetString("MessageStatusAlreadyGenerate", resourceCulture); + } + } + + /// + /// 生成が完了しました。 に類似しているローカライズされた文字列を検索します。 + /// + public static string MessageStatusCompleteGenerate { + get { + return ResourceManager.GetString("MessageStatusCompleteGenerate", resourceCulture); + } + } + + /// + /// 入力ファイルが指定されていません。 に類似しているローカライズされた文字列を検索します。 + /// + public static string MessageStatusInputFileEmpty { + get { + return ResourceManager.GetString("MessageStatusInputFileEmpty", resourceCulture); + } + } + + /// + /// 生成しています。({0}/{1}) に類似しているローカライズされた文字列を検索します。 + /// + public static string MessageStatusNowGenerating { + get { + return ResourceManager.GetString("MessageStatusNowGenerating", resourceCulture); + } + } + + /// + /// 撮影日時 に類似しているローカライズされた文字列を検索します。 + /// + public static string ShootingDateAndTime { + get { + return ResourceManager.GetString("ShootingDateAndTime", resourceCulture); + } + } + + /// + /// シャッター速度 に類似しているローカライズされた文字列を検索します。 + /// + public static string ShutterSpeed { + get { + return ResourceManager.GetString("ShutterSpeed", resourceCulture); + } + } + } +} diff --git a/src/PhotoFrameGenerator/Resources/Strings.resx b/src/PhotoFrameGenerator/Resources/Strings.resx new file mode 100644 index 0000000..84f3d37 --- /dev/null +++ b/src/PhotoFrameGenerator/Resources/Strings.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 重要なお知らせ + + + 致命的なエラーが発生しました。 +このアプリケーションを終了します。 +エラーの詳細な情報を表示しますか? + + + 入力ファイル追加 + + + ファイルもしくはファイルが含まれるフォルダをドラッグ&ドロップしてください。 + + + 入力ファイル一覧 + + + 表示するEXIF情報 + + + カメラ名 + + + レンズ名 + + + 焦点距離 + + + 露出モード + + + 絞り + + + シャッター速度 + + + 露出補正 + + + ISO感度 + + + 撮影日時 + + + 生成 + + + 生成しています。({0}/{1}) + + + 生成が完了しました。 + + + 入力ファイルが指定されていません。 + + + 準備が完了しました。「生成」ボタン押下で生成を行います。 + + + クリア + + + このアプリケーションのプロジェクトURLを開く + + \ No newline at end of file diff --git a/src/PhotoFrameGenerator/ViewModels/MainWindowViewModel.cs b/src/PhotoFrameGenerator/ViewModels/MainWindowViewModel.cs new file mode 100644 index 0000000..938e0f3 --- /dev/null +++ b/src/PhotoFrameGenerator/ViewModels/MainWindowViewModel.cs @@ -0,0 +1,279 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using PhotoFrameGenerator.Models; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.IO; +using System.Reflection; +using System.Windows; +using static PhotoFrameGenerator.Models.ImageHelper; + +namespace PhotoFrameGenerator.ViewModels +{ + internal partial class MainWindowViewModel : ObservableObject + { + //-------------------------------------------------- + // バインディングデータ + //-------------------------------------------------- + /// + /// タイトル + /// + [ObservableProperty] + private string _title = string.Empty; + + /// + /// 入力ファイル + /// + [ObservableProperty] + private ObservableCollection _inputFiles = []; + + /// + /// 表示有無(カメラ名) + /// + [ObservableProperty] + private bool _isDisplayCameraModel = true; + + /// + /// 表示有無(レンズ名) + /// + [ObservableProperty] + private bool _isDisplayLensModel = true; + + /// + /// 表示有無(焦点距離) + /// + [ObservableProperty] + private bool _isDisplayFocalLength = true; + + /// + /// 表示有無(露出モード) + /// + [ObservableProperty] + private bool _isDisplayExposureMode = true; + + /// + /// 表示有無(絞り) + /// + [ObservableProperty] + private bool _isDisplayAperture = true; + + /// + /// 表示有無(シャッタースピード) + /// + [ObservableProperty] + private bool _isDisplayShutterSpeed = true; + + /// + /// 表示有無(露出補正) + /// + [ObservableProperty] + private bool _isDisplayExposureCompensation = true; + + /// + /// 表示有無(ISO感度) + /// + [ObservableProperty] + private bool _isDisplayISOSensitivity = true; + + /// + /// 表示有無(撮影日時) + /// + [ObservableProperty] + private bool _isDisplayShootingDateAndTime = true; + + /// + /// 操作可能フラグ + /// + [ObservableProperty] + private bool _isOperationEnable = false; + + /// + /// 状態メッセージ + /// + [ObservableProperty] + private string _statusMessage = Resources.Strings.MessageStatusInputFileEmpty; + + /// + /// タイトル + /// + [ObservableProperty] + private string _copyright = string.Empty; + + //-------------------------------------------------- + // バインディングコマンド + //-------------------------------------------------- + /// + /// ドラッグ + /// + [RelayCommand] + private static void PreviewDragOver(DragEventArgs e) => ExecuteCommandPreviewDragOver(e); + + /// + /// ドロップ + /// + [RelayCommand] + private void Drop(DragEventArgs e) => ExecuteCommandDrop(e); + + /// + /// クリア + /// + [RelayCommand] + private void Clear() => ExecuteCommandClear(); + + /// + /// 生成 + /// + [RelayCommand] + private void Generate() => ExecuteCommandGenerate(); + + /// + /// プロジェクトのURLを開く + /// + [RelayCommand] + private static void OpenProjectUrl() => ExecuteCommandOpenProjectUrl(); + + //-------------------------------------------------- + // 内部変数 + //-------------------------------------------------- + /// + /// 進捗(最大値) + /// + private int _progressMaximum = 1; + + /// + /// 進捗(現在値) + /// + private int _progressValue = 0; + + //-------------------------------------------------- + // メソッド + //-------------------------------------------------- + /// + /// コンストラクタ + /// + public MainWindowViewModel() + { + Assembly assm = Assembly.GetExecutingAssembly(); + string version = assm.GetCustomAttribute()?.InformationalVersion ?? string.Empty; + + // バージョン情報を取得してタイトルに反映する + Title = $"PhotoFrameGenerator Ver.{version}"; + + // コピーライト情報を取得して設定 + Copyright = assm.GetCustomAttribute()?.Copyright ?? string.Empty; + } + + /// + /// ドラッグコマンド実行処理 + /// + /// イベントデータ + private static void ExecuteCommandPreviewDragOver(DragEventArgs e) + { + // ドラッグしてきたデータがファイルの場合、ドロップを許可する。 + e.Effects = DragDropEffects.Copy; + e.Handled = e.Data.GetDataPresent(DataFormats.FileDrop); + } + + /// + /// ドロップコマンド実行処理 + /// + /// イベントデータ + private void ExecuteCommandDrop(DragEventArgs e) + { + if (e.Data.GetData(DataFormats.FileDrop) is string[] dropitems) + { + foreach (string dropitem in dropitems) + { + if (Directory.Exists(dropitem)) + { + if (Directory.GetFiles(@dropitem, "*", SearchOption.AllDirectories) is string[] files) + { + foreach (string file in files) + { + if (ImageHelper.IsJpeg(file)) + { + InputFiles.Add(file); + } + } + } + } + else + { + if (ImageHelper.IsJpeg(dropitem)) + { + InputFiles.Add(dropitem); + } + } + } + } + + if(InputFiles.Count != 0) + { + IsOperationEnable = true; + StatusMessage = Resources.Strings.MessageStatusAlreadyGenerate; + } + else + { + IsOperationEnable = false; + StatusMessage = Resources.Strings.MessageStatusInputFileEmpty; + } + } + + /// + /// クリアコマンド実行処理 + /// + private void ExecuteCommandClear() + { + InputFiles.Clear(); + IsOperationEnable = false; + StatusMessage = Resources.Strings.MessageStatusInputFileEmpty; + } + + /// + /// 生成コマンド実行処理 + /// + private async void ExecuteCommandGenerate() + { + FrameDisplaySettings frameDisplaySettings = new() + { + IsDisplayCameraModel = IsDisplayCameraModel, + IsDisplayLensModel = IsDisplayLensModel, + IsDisplayFocalLength = IsDisplayFocalLength, + IsDisplayExposureMode = IsDisplayExposureMode, + IsDisplayAperture = IsDisplayAperture, + IsDisplayShutterSpeed = IsDisplayShutterSpeed, + IsDisplayExposureCompensation = IsDisplayExposureCompensation, + IsDisplayISOSensitivity = IsDisplayISOSensitivity, + IsDisplayShootingDateAndTime = IsDisplayShootingDateAndTime + }; + _progressMaximum = InputFiles.Count; + _progressValue = 0; + StatusMessage = string.Format(Resources.Strings.MessageStatusNowGenerating, _progressValue, _progressMaximum); + + await Task.Run(() => + { + foreach (string file in InputFiles) + { + ImageHelper.GenerateFramedImage(file, frameDisplaySettings); + _progressValue++; + StatusMessage = string.Format(Resources.Strings.MessageStatusNowGenerating, _progressValue, _progressMaximum); + } + }); + + StatusMessage = Resources.Strings.MessageStatusCompleteGenerate; + } + + /// + /// プロジェクトのURLを開くコマンド実行処理 + /// + private static void ExecuteCommandOpenProjectUrl() + { + ProcessStartInfo psi = new() + { + FileName = @"https://github.com/overdrive1708/PhotoFrameGenerator", + UseShellExecute = true + }; + Process.Start(psi); + } + } +} diff --git a/src/PhotoFrameGenerator/Views/MainWindow.xaml b/src/PhotoFrameGenerator/Views/MainWindow.xaml index e1bbb48..1b4e2a1 100644 --- a/src/PhotoFrameGenerator/Views/MainWindow.xaml +++ b/src/PhotoFrameGenerator/Views/MainWindow.xaml @@ -2,11 +2,104 @@ x:Class="PhotoFrameGenerator.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:bh="http://schemas.microsoft.com/xaml/behaviors" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - Title="MainWindow" - Width="800" - Height="480" + xmlns:resources="clr-namespace:PhotoFrameGenerator.Resources" + xmlns:ui="http://schemas.modernwpf.com/2019" + xmlns:viewmodels="clr-namespace:PhotoFrameGenerator.ViewModels" + Title="{Binding Title}" + Width="1280" + Height="800" + d:DataContext="{d:DesignInstance Type=viewmodels:MainWindowViewModel, + IsDesignTimeCreatable=True}" + ui:WindowHelper.UseModernWindowStyle="True" mc:Ignorable="d"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +