From a81451bd6bf886c73df0fbd547a2d9cb7c8a6d70 Mon Sep 17 00:00:00 2001 From: Maddo Date: Thu, 28 Sep 2017 14:50:24 +0200 Subject: [PATCH] Menu testo e fix float margine --- CatalogLib/ImgSharpCreator.cs | 4 +- CatalogLib/PicSettings.cs | 4 +- WPFCatalog/Controls/TextSettingsControl.xaml | 55 +++++++++----------- WPFCatalog/MainWindowViewModel.cs | 8 ++- imagecatalog/ImageCreator.vb | 8 +-- imagecatalog/collini_canon.xml | 4 +- 6 files changed, 42 insertions(+), 41 deletions(-) diff --git a/CatalogLib/ImgSharpCreator.cs b/CatalogLib/ImgSharpCreator.cs index 6a88194..2f02bef 100644 --- a/CatalogLib/ImgSharpCreator.cs +++ b/CatalogLib/ImgSharpCreator.cs @@ -313,12 +313,12 @@ namespace CatalogLib font = new Font(fo, dimensioneStandard, FontStyle.Regular); } - image.Mutate(x => x.DrawText(text, font, gBack, new PointF(xCenterofImg + 1 , yPosFromBottom + 1), new TextGraphicsOptions() + image.Mutate(x => x.DrawText(text, font, gBack, new PointF((float)Math.Round(xCenterofImg + 1) , (float)Math.Round(yPosFromBottom + 1)), new TextGraphicsOptions() { HorizontalAlignment = HorizontalAlignment.Center })); - image.Mutate(x => x.DrawText(text, font, g, new PointF(xCenterofImg, yPosFromBottom), new TextGraphicsOptions() + image.Mutate(x => x.DrawText(text, font, g, new PointF((float)Math.Round(xCenterofImg), (float)Math.Round(yPosFromBottom)), new TextGraphicsOptions() { HorizontalAlignment = HorizontalAlignment.Center })); diff --git a/CatalogLib/PicSettings.cs b/CatalogLib/PicSettings.cs index 8afa9a7..2971e88 100644 --- a/CatalogLib/PicSettings.cs +++ b/CatalogLib/PicSettings.cs @@ -313,8 +313,8 @@ namespace CatalogLib set { SetString("DirDestinazione", value); } } - public float Margine { get => GetFloat("Margin", 1); - set => SetFloat("Margin", value); + public int Margine { get => GetInt("Margin", 1); + set => SetInt("Margin", value); } public float MargVert { get; set; } public string Allineamento { get; set; } diff --git a/WPFCatalog/Controls/TextSettingsControl.xaml b/WPFCatalog/Controls/TextSettingsControl.xaml index f7c6e6f..dc66fcf 100644 --- a/WPFCatalog/Controls/TextSettingsControl.xaml +++ b/WPFCatalog/Controls/TextSettingsControl.xaml @@ -19,6 +19,11 @@ + + + + + @@ -88,28 +93,8 @@ - - - - - - - - - - - - - - - - - - + + @@ -124,9 +109,19 @@ diff --git a/WPFCatalog/MainWindowViewModel.cs b/WPFCatalog/MainWindowViewModel.cs index 7d7beb0..1f79209 100644 --- a/WPFCatalog/MainWindowViewModel.cs +++ b/WPFCatalog/MainWindowViewModel.cs @@ -805,7 +805,7 @@ namespace WPFCatalog set { PicSettings.Threading = value; RaisePropertyChanged("Threading"); } } - public float Margine + public int Margine { get => PicSettings.Margine; set { PicSettings.Margine = value; RaisePropertyChanged("Margine"); } @@ -817,6 +817,12 @@ namespace WPFCatalog set { PicSettings.TextPosition = value; RaisePropertyChanged("TextPosition"); } } + public Alignments TextAlignment + { + get => PicSettings.TextAlignment; + set { PicSettings.TextAlignment = value; RaisePropertyChanged("TextAlignment"); } + } + //public PicSettings.Positions Positions //{ // get => PicSettings.Positions; diff --git a/imagecatalog/ImageCreator.vb b/imagecatalog/ImageCreator.vb index d95c7ef..923bc0c 100644 --- a/imagecatalog/ImageCreator.vb +++ b/imagecatalog/ImageCreator.vb @@ -1,4 +1,6 @@ -Imports System.IO +Option Strict Off +Option Infer On +Imports System.IO Imports System.Drawing.Drawing2D Imports System.Drawing.Imaging 'Imports System.Threading @@ -564,12 +566,12 @@ Catch ex As Exception Private Sub aggiungiLogo(imgOutputBig As Bitmap) 'imgOutputBig - If PicSettings.LogoAggiungi = True And File.Exists(PicSettings.LogoNomeFile) Then + If PicSettings.LogoAggiungi = True And (File.Exists(PicSettings.LogoNomeFile) Or PicSettings.LockDownMode )Then Dim ImmagineLogo As Image If (PicSettings.LockDownMode) - ImmagineLogo = PicSettings.BuiltInImage + ImmagineLogo = PicSettings.BuiltInImage.Clone() Else ImmagineLogo = Image.FromFile(PicSettings.LogoNomeFile) End If diff --git a/imagecatalog/collini_canon.xml b/imagecatalog/collini_canon.xml index f8524fe..19568f2 100644 --- a/imagecatalog/collini_canon.xml +++ b/imagecatalog/collini_canon.xml @@ -106,11 +106,11 @@ MarchioAltezza - 390 + 500 MarchioLarghezza - 390 + 500 MarchioMargine