From 02d6cb5d124f32945e9322b9797d5ff6bd495c4f Mon Sep 17 00:00:00 2001 From: Maddo Date: Mon, 17 Apr 2017 13:06:09 +0200 Subject: [PATCH] Resize and controls --- CatalogLib/CatalogLib.csproj | 8 ++++---- CatalogLib/ImgSharpCreator.cs | 14 +++++++++++--- CatalogLib/PicSettings.cs | 10 ++++++++++ CatalogLib/packages.config | 8 ++++---- WPFCatalog/Controls/TextSettingsControl.xaml | 2 +- WPFCatalog/MainWindowViewModel.cs | 6 +++--- 6 files changed, 33 insertions(+), 15 deletions(-) diff --git a/CatalogLib/CatalogLib.csproj b/CatalogLib/CatalogLib.csproj index 9e429d3..b7c81ff 100644 --- a/CatalogLib/CatalogLib.csproj +++ b/CatalogLib/CatalogLib.csproj @@ -54,10 +54,10 @@ - ..\packages\ImageSharp.1.0.0-alpha4-00046\lib\netstandard1.3\ImageSharp.dll + ..\packages\ImageSharp.1.0.0-alpha6-00049\lib\netstandard1.3\ImageSharp.dll - ..\packages\ImageSharp.Drawing.1.0.0-alpha4-00046\lib\netstandard1.1\ImageSharp.Drawing.dll + ..\packages\ImageSharp.Drawing.1.0.0-alpha6-00010\lib\netstandard1.1\ImageSharp.Drawing.dll ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll @@ -67,10 +67,10 @@ True - ..\packages\SixLabors.Fonts.0.1.0-alpha0002\lib\netstandard1.3\SixLabors.Fonts.dll + ..\packages\SixLabors.Fonts.0.1.0-alpha0008\lib\netstandard1.3\SixLabors.Fonts.dll - ..\packages\SixLabors.Shapes.0.1.0-alpha0009\lib\netstandard1.1\SixLabors.Shapes.dll + ..\packages\SixLabors.Shapes.0.1.0-alpha0011\lib\netstandard1.1\SixLabors.Shapes.dll diff --git a/CatalogLib/ImgSharpCreator.cs b/CatalogLib/ImgSharpCreator.cs index dfe5cf7..527cb74 100644 --- a/CatalogLib/ImgSharpCreator.cs +++ b/CatalogLib/ImgSharpCreator.cs @@ -24,7 +24,10 @@ namespace CatalogLib public void Start(FileInfo workFile) { _currentFile = workFile; - using (Image image = new Image(workFile.FullName)) + + + + using (Image image = Image.Load(workFile.FullName)/* new Image(workFile.FullName)*/) { if (PicSettings.Instance.UsaRotazioneAutomatica) { @@ -79,7 +82,10 @@ namespace CatalogLib } - SetExtraText(image); + if (PicSettings.Instance.EnableText) + { + SetExtraText(image); + } //JpegDecoder j = new JpegDecoder(); var va = Vector.IsHardwareAccelerated; @@ -105,10 +111,12 @@ namespace CatalogLib var fff = FontCollection.SystemFonts.Find(PicSettings.Instance.NomeFont); //var fff = FontCollection.SystemFonts.Find("Segoe Print"); - var font = new Font(fff, (float) PicSettings.Instance.DimensioneFont, FontStyle.Regular); + var font = new Font(fff, (float)PicSettings.Instance.DimensioneFont, FontStyle.Regular); //var font = new Font(fff, 8f, FontStyle.Regular); + Color c = Color.FromHex(PicSettings.Instance.ColoreTestoRGB); + //image.DrawText(PicSettings.Instance.TestoApplicareOrizzontale, font, Color.Black, ) image.DrawText(PicSettings.Instance.TestoApplicareOrizzontale, font, Color.Black, new Vector2(200, 200)); //image.DrawText("sssssssssssssssssssssssssssssssssssssssssssssss", font, Color.Black, new Vector2(200, 200)); diff --git a/CatalogLib/PicSettings.cs b/CatalogLib/PicSettings.cs index 33f02b7..144d601 100644 --- a/CatalogLib/PicSettings.cs +++ b/CatalogLib/PicSettings.cs @@ -422,6 +422,16 @@ namespace CatalogLib } } + public string ColoreTestoRGB + { + get { return GetString("coloreTestoRGB", "#000000"); } + set + { + Set("coloreTestoRGB", value); + + } + } + #endregion diff --git a/CatalogLib/packages.config b/CatalogLib/packages.config index 9909fb0..f61b9a4 100644 --- a/CatalogLib/packages.config +++ b/CatalogLib/packages.config @@ -1,13 +1,13 @@  - - + + - - + + diff --git a/WPFCatalog/Controls/TextSettingsControl.xaml b/WPFCatalog/Controls/TextSettingsControl.xaml index d2b538a..27566c6 100644 --- a/WPFCatalog/Controls/TextSettingsControl.xaml +++ b/WPFCatalog/Controls/TextSettingsControl.xaml @@ -15,7 +15,7 @@ - + diff --git a/WPFCatalog/MainWindowViewModel.cs b/WPFCatalog/MainWindowViewModel.cs index d92f81d..b383343 100644 --- a/WPFCatalog/MainWindowViewModel.cs +++ b/WPFCatalog/MainWindowViewModel.cs @@ -687,11 +687,11 @@ namespace WPFCatalog public string ColoreTestoRGB - { - get { return PicSettings.GetString("coloreTestoRGB", "#000000"); } + { + get { return PicSettings.ColoreTestoRGB; } set { - PicSettings.Set("coloreTestoRGB", value); + PicSettings.ColoreTestoRGB = value; RaisePropertyChanged("ColoreTestoRGB"); } }