diff --git a/FoliCon/FoliCon.csproj b/FoliCon/FoliCon.csproj index f9761347..588a90e7 100644 --- a/FoliCon/FoliCon.csproj +++ b/FoliCon/FoliCon.csproj @@ -23,6 +23,7 @@ dineshsolanki.github.io/folicon/ + @@ -57,6 +58,7 @@ dineshsolanki.github.io/folicon/ + diff --git a/FoliCon/Models/GlobalVariables.cs b/FoliCon/Models/GlobalVariables.cs index 9fbdbdc3..c962b05f 100644 --- a/FoliCon/Models/GlobalVariables.cs +++ b/FoliCon/Models/GlobalVariables.cs @@ -14,6 +14,7 @@ public static IconOverlay IconOverlayType() "Alternate" => IconOverlay.Alternate, "Liaher" => IconOverlay.Liaher, "Faelpessoal" => IconOverlay.Faelpessoal, + "FaelpessoalHorizontal" => IconOverlay.FaelpessoalHorizontal, _ => IconOverlay.Alternate }; } diff --git a/FoliCon/Models/IconOverlay.cs b/FoliCon/Models/IconOverlay.cs index 6bdc2ac9..873287cb 100644 --- a/FoliCon/Models/IconOverlay.cs +++ b/FoliCon/Models/IconOverlay.cs @@ -5,6 +5,7 @@ public enum IconOverlay Legacy, Alternate, Liaher, - Faelpessoal + Faelpessoal, + FaelpessoalHorizontal } } \ No newline at end of file diff --git a/FoliCon/Modules/LangProvider.cs b/FoliCon/Modules/LangProvider.cs index 4c23ade3..149d4a6d 100644 --- a/FoliCon/Modules/LangProvider.cs +++ b/FoliCon/Modules/LangProvider.cs @@ -166,6 +166,8 @@ private void UpdateLangs() OnPropertyChanged(nameof(DeleteMediaInfoConfirmation)); OnPropertyChanged(nameof(ConfirmMediaInfoDeletion)); OnPropertyChanged(nameof(PosterIconOverlay)); + OnPropertyChanged(nameof(SelectPosterIconOverlay)); + OnPropertyChanged(nameof(BestSuitedForHorizontal)); } public string About => Lang.About; @@ -421,6 +423,8 @@ private void UpdateLangs() public string DeleteMediaInfoTooltip => Lang.DeleteMediaInfoTooltip; public string DeleteMediaInfo => Lang.DeleteMediaInfo; public string PosterIconOverlay => Lang.PosterIconOverlay; + public string SelectPosterIconOverlay => Lang.SelectPosterIconOverlay; + public string BestSuitedForHorizontal => Lang.BestSuitedForHorizontal; public event PropertyChangedEventHandler PropertyChanged; @@ -685,5 +689,7 @@ public class LangKeys public static string DeleteMediaInfoTooltip = nameof(DeleteMediaInfoTooltip); public static string DeleteMediaInfo = nameof(DeleteMediaInfo); public static string PosterIconOverlay = nameof(PosterIconOverlay); + public static string SelectPosterIconOverlay = nameof(SelectPosterIconOverlay); + public static string BestSuitedForHorizontal = nameof(BestSuitedForHorizontal); } } \ No newline at end of file diff --git a/FoliCon/Modules/Util.cs b/FoliCon/Modules/Util.cs index c6ba96b7..fe395f4a 100644 --- a/FoliCon/Modules/Util.cs +++ b/FoliCon/Modules/Util.cs @@ -486,6 +486,9 @@ public static void BuildFolderIco(string iconMode, string filmFolderPath, string IconOverlay.Faelpessoal => StaTask.Start(() => new PosterIconFaelpessoal(new PosterIcon( filmFolderPath, rating, ratingVisibility, mockupVisibility, mediaTitle)).RenderToBitmap()), + IconOverlay.FaelpessoalHorizontal => StaTask.Start(() => new PosterIconFaelpessoalHorizontal(new PosterIcon( + filmFolderPath, rating, + ratingVisibility, mockupVisibility, mediaTitle)).RenderToBitmap()), _ => StaTask.Start(() => new Views.PosterIcon(new PosterIcon(filmFolderPath, rating, ratingVisibility, mockupVisibility)) .RenderToBitmap()) diff --git a/FoliCon/Properties/Langs/Lang.Designer.cs b/FoliCon/Properties/Langs/Lang.Designer.cs index bec0c296..7f58aedd 100644 --- a/FoliCon/Properties/Langs/Lang.Designer.cs +++ b/FoliCon/Properties/Langs/Lang.Designer.cs @@ -150,6 +150,15 @@ public static string Auto { } } + /// + /// Looks up a localized string similar to Best suited for horizontal images, such as game artworks.. + /// + public static string BestSuitedForHorizontal { + get { + return ResourceManager.GetString("BestSuitedForHorizontal", resourceCulture); + } + } + /// /// Looks up a localized string similar to Browse Folder/Drop here. /// @@ -1048,6 +1057,15 @@ public static string SelectIconsDirectory { } } + /// + /// Looks up a localized string similar to Select Poster Icon overlay. + /// + public static string SelectPosterIconOverlay { + get { + return ResourceManager.GetString("SelectPosterIconOverlay", resourceCulture); + } + } + /// /// Looks up a localized string similar to Settings. /// diff --git a/FoliCon/Properties/Langs/Lang.ar.resx b/FoliCon/Properties/Langs/Lang.ar.resx index ae70ae9d..407986fe 100644 --- a/FoliCon/Properties/Langs/Lang.ar.resx +++ b/FoliCon/Properties/Langs/Lang.ar.resx @@ -515,4 +515,10 @@ تراكب أيقونة الملصق + + الأنسب للصور الأفقية ، مثل الأعمال الفنية للعبة. + + + حدد تراكب أيقونة الملصق + \ No newline at end of file diff --git a/FoliCon/Properties/Langs/Lang.es.resx b/FoliCon/Properties/Langs/Lang.es.resx index 1c8dac34..d4544a39 100644 --- a/FoliCon/Properties/Langs/Lang.es.resx +++ b/FoliCon/Properties/Langs/Lang.es.resx @@ -515,4 +515,10 @@ Esto ayuda a folicon a identificar los medios sin tener que elegir entre título Superposición de icono de póster + + Más adecuado para imágenes horizontales, como obras de arte de juegos. + + + Seleccionar superposición de icono de póster + \ No newline at end of file diff --git a/FoliCon/Properties/Langs/Lang.hi.resx b/FoliCon/Properties/Langs/Lang.hi.resx index f43e8e64..2134d847 100644 --- a/FoliCon/Properties/Langs/Lang.hi.resx +++ b/FoliCon/Properties/Langs/Lang.hi.resx @@ -515,4 +515,10 @@ पोस्टर आइकन ओवरले + + क्षैतिज छवियों के लिए सबसे उपयुक्त, जैसे कि गेम आर्टवर्क। + + + पोस्टर आइकन ओवरले का चयन करें + \ No newline at end of file diff --git a/FoliCon/Properties/Langs/Lang.resx b/FoliCon/Properties/Langs/Lang.resx index b0856978..8b31fb69 100644 --- a/FoliCon/Properties/Langs/Lang.resx +++ b/FoliCon/Properties/Langs/Lang.resx @@ -147,6 +147,9 @@ Auto (Movies & TV Shows) + + Best suited for horizontal images, such as game artworks. + Browse Folder/Drop here @@ -451,6 +454,9 @@ and refresh Icon Cache? Select Icons Directory + + Select Poster Icon overlay + Settings diff --git a/FoliCon/Properties/Langs/Lang.ru.resx b/FoliCon/Properties/Langs/Lang.ru.resx index 8b5a9ae4..296f4659 100644 --- a/FoliCon/Properties/Langs/Lang.ru.resx +++ b/FoliCon/Properties/Langs/Lang.ru.resx @@ -515,4 +515,10 @@ Наложение значка плаката + + Лучше всего подходит для горизонтальных изображений, таких как игровые иллюстрации. + + + Выберите наложение значка плаката + \ No newline at end of file diff --git a/FoliCon/Resources/mockup faelpessoal base horizontal.png b/FoliCon/Resources/mockup faelpessoal base horizontal.png index 5f31bbb5..59b6f3b8 100644 Binary files a/FoliCon/Resources/mockup faelpessoal base horizontal.png and b/FoliCon/Resources/mockup faelpessoal base horizontal.png differ diff --git a/FoliCon/ViewModels/posterIconConfigViewModel.cs b/FoliCon/ViewModels/posterIconConfigViewModel.cs index d2c65153..6b62fc7c 100644 --- a/FoliCon/ViewModels/posterIconConfigViewModel.cs +++ b/FoliCon/ViewModels/posterIconConfigViewModel.cs @@ -3,6 +3,7 @@ using Prism.Services.Dialogs; using System; using System.Globalization; +using FoliCon.Properties.Langs; namespace FoliCon.ViewModels { @@ -17,7 +18,7 @@ public PosterIconConfigViewModel() .Property(p => p.IconOverlay, defaultValue: "Alternate") .PersistOn(nameof(PropertyChanged)); Services.Tracker.Track(this); - IconOverlayChangedCommand = new DelegateCommand(delegate (object parameter) + IconOverlayChangedCommand = new DelegateCommand(delegate(object parameter) { IconOverlay = (string)parameter; }); @@ -29,7 +30,7 @@ public string IconOverlay set => SetProperty(ref _iconOverlay, value); } - public string Title => "Select Poster Icon overlay"; + public string Title => LangProvider.GetLang("SelectPosterIconOverlay"); #region DialogMethods diff --git a/FoliCon/Views/PosterIconFaelpessoalHorizontal.xaml b/FoliCon/Views/PosterIconFaelpessoalHorizontal.xaml index e9333a80..633cc675 100644 --- a/FoliCon/Views/PosterIconFaelpessoalHorizontal.xaml +++ b/FoliCon/Views/PosterIconFaelpessoalHorizontal.xaml @@ -16,7 +16,7 @@ - + diff --git a/FoliCon/Views/PosterIconFaelpessoalHorizontal.xaml.cs b/FoliCon/Views/PosterIconFaelpessoalHorizontal.xaml.cs index 2f505772..2f3971ae 100644 --- a/FoliCon/Views/PosterIconFaelpessoalHorizontal.xaml.cs +++ b/FoliCon/Views/PosterIconFaelpessoalHorizontal.xaml.cs @@ -1,17 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Drawing; +using System.IO; using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; namespace FoliCon.Views { @@ -24,5 +16,36 @@ public PosterIconFaelpessoalHorizontal() { InitializeComponent(); } + + public PosterIconFaelpessoalHorizontal(object dataContext) + { + DataContext = dataContext; + InitializeComponent(); + } + public Bitmap RenderToBitmap() + { + return RenderTargetBitmapTo32BppArgb(AsRenderTargetBitmap()); + } + + private RenderTargetBitmap AsRenderTargetBitmap() + { + var size = new System.Windows.Size(256, 256); + Measure(size); + Arrange(new Rect(size)); + + var rtb = new RenderTargetBitmap((int)size.Width, (int)size.Height, 96, 96, PixelFormats.Default); + rtb.Render(this); + + return rtb; + } + + private static Bitmap RenderTargetBitmapTo32BppArgb(BitmapSource rtb) + { + var stream = new MemoryStream(); + BitmapEncoder encoder = new PngBitmapEncoder(); + encoder.Frames.Add(BitmapFrame.Create(rtb)); + encoder.Save(stream); + return new Bitmap(stream); + } } } diff --git a/FoliCon/Views/posterIconConfig.xaml b/FoliCon/Views/posterIconConfig.xaml index c093e130..db03f17e 100644 --- a/FoliCon/Views/posterIconConfig.xaml +++ b/FoliCon/Views/posterIconConfig.xaml @@ -21,7 +21,7 @@