diff --git a/Yugen.Mosaic.Uwp/Assets/Store/Screenshot.png b/Yugen.Mosaic.Uwp/Assets/Store/Screenshot.png index 0d14682..6cb8bdf 100644 Binary files a/Yugen.Mosaic.Uwp/Assets/Store/Screenshot.png and b/Yugen.Mosaic.Uwp/Assets/Store/Screenshot.png differ diff --git a/Yugen.Mosaic.Uwp/Assets/Store/Screenshot2.png b/Yugen.Mosaic.Uwp/Assets/Store/Screenshot2.png new file mode 100644 index 0000000..0d14682 Binary files /dev/null and b/Yugen.Mosaic.Uwp/Assets/Store/Screenshot2.png differ diff --git a/Yugen.Mosaic.Uwp/Controls/AlignmentGrid.cs b/Yugen.Mosaic.Uwp/Controls/AlignmentGrid.cs index b71f013..27e08de 100644 --- a/Yugen.Mosaic.Uwp/Controls/AlignmentGrid.cs +++ b/Yugen.Mosaic.Uwp/Controls/AlignmentGrid.cs @@ -133,7 +133,7 @@ private void Rebuild() Height = ActualHeight, Fill = brush }; - Canvas.SetLeft(line, MathHelper.RangesConverter(x, 0, ContainerWidth, 0, ActualWidth)); + Canvas.SetLeft(line, MathHelper.RangeConvert(x, 0, ContainerWidth, 0, ActualWidth)); containerCanvas.Children.Add(line); } @@ -149,7 +149,7 @@ private void Rebuild() Height = 1, Fill = brush }; - Canvas.SetTop(line, MathHelper.RangesConverter(y, 0, ContainerHeight, 0, ActualHeight)); + Canvas.SetTop(line, MathHelper.RangeConvert(y, 0, ContainerHeight, 0, ActualHeight)); containerCanvas.Children.Add(line); } diff --git a/Yugen.Mosaic.Uwp/Enums/FileFormat.cs b/Yugen.Mosaic.Uwp/Enums/FileFormat.cs index bba1ec7..28343ed 100644 --- a/Yugen.Mosaic.Uwp/Enums/FileFormat.cs +++ b/Yugen.Mosaic.Uwp/Enums/FileFormat.cs @@ -1,11 +1,18 @@ -namespace Yugen.Mosaic.Uwp.Enums +using System.ComponentModel; + +namespace Yugen.Mosaic.Uwp.Enums { public enum FileFormat { + [Description(".jpg")] Jpg, + [Description(".png")] Png, + [Description(".bmp")] Bmp, + [Description(".tiff")] Tiff, + [Description(".gif")] Gif } } diff --git a/Yugen.Mosaic.Uwp/Models/MosaicTypeEnum.cs b/Yugen.Mosaic.Uwp/Enums/MosaicTypeEnum.cs similarity index 89% rename from Yugen.Mosaic.Uwp/Models/MosaicTypeEnum.cs rename to Yugen.Mosaic.Uwp/Enums/MosaicTypeEnum.cs index 6eed77b..7d15b94 100644 --- a/Yugen.Mosaic.Uwp/Models/MosaicTypeEnum.cs +++ b/Yugen.Mosaic.Uwp/Enums/MosaicTypeEnum.cs @@ -1,6 +1,6 @@ using System.ComponentModel; -namespace Yugen.Mosaic.Uwp.Models +namespace Yugen.Mosaic.Uwp.Enums { public enum MosaicTypeEnum { diff --git a/Yugen.Mosaic.Uwp/Models/OnboardingStage.cs b/Yugen.Mosaic.Uwp/Enums/OnboardingStage.cs similarity index 83% rename from Yugen.Mosaic.Uwp/Models/OnboardingStage.cs rename to Yugen.Mosaic.Uwp/Enums/OnboardingStage.cs index db40c69..91b2221 100644 --- a/Yugen.Mosaic.Uwp/Models/OnboardingStage.cs +++ b/Yugen.Mosaic.Uwp/Enums/OnboardingStage.cs @@ -1,4 +1,4 @@ -namespace Yugen.Mosaic.Uwp.Models +namespace Yugen.Mosaic.Uwp.Enums { public enum OnboardingStage { diff --git a/Yugen.Mosaic.Uwp/Extensions/FileFormatExtensions.cs b/Yugen.Mosaic.Uwp/Extensions/FileFormatExtensions.cs deleted file mode 100644 index 0110fd8..0000000 --- a/Yugen.Mosaic.Uwp/Extensions/FileFormatExtensions.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Yugen.Mosaic.Uwp.Enums; - -namespace Yugen.Mosaic.Uwp.Extensions -{ - public static class FileFormatExtensions - { - public static string FileFormatToString(this FileFormat fileFormat) => $".{fileFormat.ToString().ToLower()}"; - } -} diff --git a/Yugen.Mosaic.Uwp/Extensions/SettingsStorageExtensions.cs b/Yugen.Mosaic.Uwp/Extensions/SettingsStorageExtensions.cs deleted file mode 100644 index dfd7b75..0000000 --- a/Yugen.Mosaic.Uwp/Extensions/SettingsStorageExtensions.cs +++ /dev/null @@ -1,98 +0,0 @@ -//using System; -//using System.IO; -//using System.Threading.Tasks; -//using Windows.Storage; -//using Windows.Storage.Streams; -//using Yugen.Toolkit.Standard.Providers; - -//namespace Yugen.Mosaic.Uwp.Extensions -//{ - -// public static class SettingsStorageExtensions -// { -// private const string FileExtension = ".json"; - -// public static bool IsRoamingStorageAvailable(this ApplicationData appData) -// { -// return appData.RoamingStorageQuota == 0; -// } - -// public static async Task SaveAsync(this StorageFolder folder, string name, T content) -// { -// var file = await folder.CreateFileAsync(GetFileName(name), CreationCollisionOption.ReplaceExisting); -// var fileContent = await JsonProvider.StringifyAsync(content); - -// await FileIO.WriteTextAsync(file, fileContent); -// } - -// public static async Task ReadAsync(this StorageFolder folder, string name) -// { -// if (!File.Exists(Path.Combine(folder.Path, GetFileName(name)))) -// { -// return default; -// } - -// var file = await folder.GetFileAsync($"{name}.json"); -// var fileContent = await FileIO.ReadTextAsync(file); - -// return await JsonProvider.ToObjectAsync(fileContent); -// } - - - -// public static async Task SaveFileAsync(this StorageFolder folder, byte[] content, string fileName, CreationCollisionOption options = CreationCollisionOption.ReplaceExisting) -// { -// if (content == null) -// { -// throw new ArgumentNullException(nameof(content)); -// } - -// if (string.IsNullOrEmpty(fileName)) -// { -// throw new ArgumentException("ExceptionSettingsStorageExtensionsFileNameIsNullOrEmpty", nameof(fileName)); -// } - -// var storageFile = await folder.CreateFileAsync(fileName, options); -// await FileIO.WriteBytesAsync(storageFile, content); -// return storageFile; -// } - -// public static async Task ReadFileAsync(this StorageFolder folder, string fileName) -// { -// var item = await folder.TryGetItemAsync(fileName).AsTask().ConfigureAwait(false); - -// if (item != null && item.IsOfType(StorageItemTypes.File)) -// { -// var storageFile = await folder.GetFileAsync(fileName); -// byte[] content = await storageFile.ReadBytesAsync(); -// return content; -// } - -// return null; -// } - -// public static async Task ReadBytesAsync(this StorageFile file) -// { -// if (file != null) -// { -// using (IRandomAccessStream stream = await file.OpenReadAsync()) -// { -// using (var reader = new DataReader(stream.GetInputStreamAt(0))) -// { -// await reader.LoadAsync((uint)stream.Size); -// var bytes = new byte[stream.Size]; -// reader.ReadBytes(bytes); -// return bytes; -// } -// } -// } - -// return null; -// } - -// private static string GetFileName(string name) -// { -// return string.Concat(name, FileExtension); -// } -// } -//} diff --git a/Yugen.Mosaic.Uwp/Helpers/ColorHelper.cs b/Yugen.Mosaic.Uwp/Helpers/ColorHelper.cs index a74a028..7c37e46 100644 --- a/Yugen.Mosaic.Uwp/Helpers/ColorHelper.cs +++ b/Yugen.Mosaic.Uwp/Helpers/ColorHelper.cs @@ -40,7 +40,6 @@ private static Rgba32 GetAverageColor(Image source, int startX, int star return new Rgba32(Convert.ToByte(aR), Convert.ToByte(aG), Convert.ToByte(aB)); } - public static int GetDifference(Rgba32 source, Rgba32 target) { var dR = Math.Abs(source.R - target.R); diff --git a/Yugen.Mosaic.Uwp/Helpers/MathHelper.cs b/Yugen.Mosaic.Uwp/Helpers/MathHelper.cs index c6ab97a..06829cd 100644 --- a/Yugen.Mosaic.Uwp/Helpers/MathHelper.cs +++ b/Yugen.Mosaic.Uwp/Helpers/MathHelper.cs @@ -1,4 +1,6 @@ -namespace Yugen.Mosaic.Uwp.Helpers +using System; + +namespace Yugen.Mosaic.Uwp.Helpers { public static class MathHelper { @@ -12,8 +14,20 @@ public static class MathHelper /// /// /// newValue - public static double RangesConverter(double oldValue, double oldMin, double oldMax, double newMin, double newMax) => + public static double RangeConvert(double oldValue, double oldMin, double oldMax, double newMin, double newMax) => (oldValue - oldMin) * (newMax - newMin) / (oldMax - oldMin) + newMin; + + public static Tuple RatioConvert(int width, int height, int newHeight, int newWidth) + { + //calculate the ratio + var ratio = (double)width / (double)height; + + //set height of image to boxHeight and check if resulting width is less than boxWidth, + //else set width of image to boxWidth and calculate new height + return (int)(newHeight * ratio) <= newWidth + ? new Tuple((int)(newHeight * ratio), newHeight) + : new Tuple(newWidth, (int)(newWidth / ratio)); + } } } \ No newline at end of file diff --git a/Yugen.Mosaic.Uwp/Helpers/OnboardingHelper.cs b/Yugen.Mosaic.Uwp/Helpers/OnboardingHelper.cs index 37c070b..fbe97c6 100644 --- a/Yugen.Mosaic.Uwp/Helpers/OnboardingHelper.cs +++ b/Yugen.Mosaic.Uwp/Helpers/OnboardingHelper.cs @@ -1,4 +1,5 @@ using Windows.UI.Xaml; +using Yugen.Mosaic.Uwp.Enums; using Yugen.Mosaic.Uwp.Models; namespace Yugen.Mosaic.Uwp.Helpers @@ -7,6 +8,8 @@ namespace Yugen.Mosaic.Uwp.Helpers public static class OnboardingHelper { private const string SettingsKey = "OnboardingIsEnabled"; + private static OnboardingElement[] _onboardingElements; + private static int _step; public static bool IsDisabled { @@ -14,9 +17,6 @@ public static bool IsDisabled set => SettingsHelper.Write(SettingsKey, value); } - private static int _step; - private static OnboardingElement[] _onboardingElements; - public static void Init(FrameworkElement[] frameworkElements) => _onboardingElements = new OnboardingElement[] { new OnboardingElement( diff --git a/Yugen.Mosaic.Uwp/Helpers/RatioHelper.cs b/Yugen.Mosaic.Uwp/Helpers/RatioHelper.cs deleted file mode 100644 index 5f3e4c6..0000000 --- a/Yugen.Mosaic.Uwp/Helpers/RatioHelper.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Yugen.Mosaic.Uwp.Helpers -{ - public static class RatioHelper - { - public static Tuple Convert(int width, int height, int newHeight, int newWidth) - { - //calculate the ratio - var ratio = (double)width / (double)height; - - //set height of image to boxHeight and check if resulting width is less than boxWidth, - //else set width of image to boxWidth and calculate new height - return (int)(newHeight * ratio) <= newWidth - ? new Tuple((int)(newHeight * ratio), newHeight) - : new Tuple(newWidth, (int)(newWidth / ratio)); - } - } -} diff --git a/Yugen.Mosaic.Uwp/Helpers/ResourceHelper.cs b/Yugen.Mosaic.Uwp/Helpers/ResourceHelper.cs index cda2e33..497e718 100644 --- a/Yugen.Mosaic.Uwp/Helpers/ResourceHelper.cs +++ b/Yugen.Mosaic.Uwp/Helpers/ResourceHelper.cs @@ -6,6 +6,7 @@ public static class ResourceHelper { private static readonly ResourceLoader _resourceLoader = _resourceLoader ?? new ResourceLoader(); - public static string GetText(string key) => _resourceLoader.GetString(key); + public static string GetText(string key) => + _resourceLoader.GetString(key); } } \ No newline at end of file diff --git a/Yugen.Mosaic.Uwp/Interfaces/IMosaicService.cs b/Yugen.Mosaic.Uwp/Interfaces/IMosaicService.cs index 172dbb7..c14d673 100644 --- a/Yugen.Mosaic.Uwp/Interfaces/IMosaicService.cs +++ b/Yugen.Mosaic.Uwp/Interfaces/IMosaicService.cs @@ -2,7 +2,7 @@ using SixLabors.ImageSharp.PixelFormats; using System.IO; using Windows.Storage.Streams; -using Yugen.Mosaic.Uwp.Models; +using Yugen.Mosaic.Uwp.Enums; namespace Yugen.Mosaic.Uwp.Interfaces { diff --git a/Yugen.Mosaic.Uwp/Models/MosaicType.cs b/Yugen.Mosaic.Uwp/Models/MosaicType.cs index 3016502..8f6712d 100644 --- a/Yugen.Mosaic.Uwp/Models/MosaicType.cs +++ b/Yugen.Mosaic.Uwp/Models/MosaicType.cs @@ -1,4 +1,5 @@ -using Yugen.Mosaic.Uwp.Extensions; +using Yugen.Mosaic.Uwp.Enums; +using Yugen.Mosaic.Uwp.Extensions; namespace Yugen.Mosaic.Uwp.Models { diff --git a/Yugen.Mosaic.Uwp/Models/OnboardingElement.cs b/Yugen.Mosaic.Uwp/Models/OnboardingElement.cs index 1d7a3d4..848feaf 100644 --- a/Yugen.Mosaic.Uwp/Models/OnboardingElement.cs +++ b/Yugen.Mosaic.Uwp/Models/OnboardingElement.cs @@ -1,18 +1,11 @@ using Windows.UI.Xaml; +using Yugen.Mosaic.Uwp.Enums; using Yugen.Mosaic.Uwp.Helpers; namespace Yugen.Mosaic.Uwp.Models { public class OnboardingElement { - public string Title { get; set; } - - public string Subtitle { get; set; } - - public FrameworkElement Target { get; set; } - - public OnboardingStage Stage { get; set; } - public OnboardingElement(FrameworkElement target, OnboardingStage stage) { Title = ResourceHelper.GetText($"OnboardingStage{stage}Title"); @@ -20,5 +13,10 @@ public OnboardingElement(FrameworkElement target, OnboardingStage stage) Target = target; Stage = stage; } + + public OnboardingStage Stage { get; set; } + public string Subtitle { get; set; } + public FrameworkElement Target { get; set; } + public string Title { get; set; } } } \ No newline at end of file diff --git a/Yugen.Mosaic.Uwp/Models/Tile.cs b/Yugen.Mosaic.Uwp/Models/Tile.cs index 76a11a8..1b17ff1 100644 --- a/Yugen.Mosaic.Uwp/Models/Tile.cs +++ b/Yugen.Mosaic.Uwp/Models/Tile.cs @@ -18,29 +18,3 @@ public Tile(Image originalImage, string name) } } } - -//Rgba32 targetColor = _averageColor.ToPixel(); - -//Color clAvg = Color.FromRgba(255, Convert.ToByte(R), Convert.ToByte(G), Convert.ToByte(B)); -//Rgba32 clAvg = Color.FromRgba(255, Convert.ToByte(R), Convert.ToByte(G), Convert.ToByte(B)); -//Rgba32 clAvg = new Rgba32(Convert.ToByte(R), Convert.ToByte(G), Convert.ToByte(B), 255); - -//TPixel pixelColor = new TPixel(); -//pixelColor.FromRgba32(clAvg); - -//public async Task RunTasks(WriteableBitmap clone) -//{ -// var tasks = new List(); - -// tasks.Add(Task.Run(() => DoWork(400, 1, clone))); -// tasks.Add(Task.Run(() => DoWork(200, 2, clone))); -// tasks.Add(Task.Run(() => DoWork(300, 3, clone))); - -// await Task.WhenAll(tasks); -//} - -//public async Task DoWork(int delay, int n, WriteableBitmap masterImageSource) -//{ -// await Task.Delay(delay); -// System.Diagnostics.Debug.WriteLine($"{n} {masterImageSource.PixelHeight}"); -//} diff --git a/Yugen.Mosaic.Uwp/Models/TileBmp.cs b/Yugen.Mosaic.Uwp/Models/TileBmp.cs index a728b2f..65a9a5a 100644 --- a/Yugen.Mosaic.Uwp/Models/TileBmp.cs +++ b/Yugen.Mosaic.Uwp/Models/TileBmp.cs @@ -4,13 +4,13 @@ namespace Yugen.Mosaic.Uwp.Models { public class TileBmp { - public string Name { get; set; } - public BitmapImage Image { get; set; } - public TileBmp(string name, BitmapImage image) { Name = name; Image = image; } + + public BitmapImage Image { get; set; } + public string Name { get; set; } } } diff --git a/Yugen.Mosaic.Uwp/Services/MosaicService.cs b/Yugen.Mosaic.Uwp/Services/MosaicService.cs index d0df937..dec1603 100644 --- a/Yugen.Mosaic.Uwp/Services/MosaicService.cs +++ b/Yugen.Mosaic.Uwp/Services/MosaicService.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using Windows.Storage.Streams; using Windows.UI.Xaml.Media.Imaging; +using Yugen.Mosaic.Uwp.Enums; using Yugen.Mosaic.Uwp.Helpers; using Yugen.Mosaic.Uwp.Interfaces; using Yugen.Mosaic.Uwp.Models; diff --git a/Yugen.Mosaic.Uwp/Services/ThemeSelectorService.cs b/Yugen.Mosaic.Uwp/Services/ThemeSelectorService.cs index bfba87f..33a4b19 100644 --- a/Yugen.Mosaic.Uwp/Services/ThemeSelectorService.cs +++ b/Yugen.Mosaic.Uwp/Services/ThemeSelectorService.cs @@ -11,10 +11,9 @@ namespace Yugen.Mosaic.Uwp.Services { public static class ThemeSelectorService { - private const string SettingsKey = "AppBackgroundRequestedTheme"; private const string DARK_THEME_BCKG = "#FF000000"; private const string LIGHT_THEME_BCKG = "#FFFFFFFF"; - + private const string SettingsKey = "AppBackgroundRequestedTheme"; public static ElementTheme Theme { get; set; } = ElementTheme.Default; public static async Task InitializeAsync() @@ -23,6 +22,20 @@ public static async Task InitializeAsync() await SetThemeAsync(theme); } + public static async Task SetRequestedThemeAsync() + { + foreach (CoreApplicationView view in CoreApplication.Views) + { + await view.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => + { + if (Window.Current.Content is FrameworkElement frameworkElement) + { + frameworkElement.RequestedTheme = Theme; + } + }); + } + } + public static async Task SetThemeAsync(ElementTheme theme) { Theme = theme; @@ -44,19 +57,21 @@ public static async Task SetThemeAsync(ElementTheme theme) titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; titleBar.ButtonInactiveForegroundColor = GetThemeResource(theme, "TitleBarButtonForeground"); } + private static T GetThemeResource(ElementTheme theme, string resKey) + { + var isLightTheme = (theme == ElementTheme.Default) + ? (IsSystemThemeLight()) + : (theme == ElementTheme.Light); + var themeKey = isLightTheme ? "Light" : "Dark"; + var themeDictionary = (ResourceDictionary)Application.Current.Resources.ThemeDictionaries[themeKey]; + return (T)themeDictionary[resKey]; + } - public static async Task SetRequestedThemeAsync() + private static bool IsSystemThemeLight() { - foreach (CoreApplicationView view in CoreApplication.Views) - { - await view.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => - { - if (Window.Current.Content is FrameworkElement frameworkElement) - { - frameworkElement.RequestedTheme = Theme; - } - }); - } + var DefaultTheme = new UISettings(); + var uiTheme = DefaultTheme.GetColorValue(UIColorType.Background).ToString(); + return uiTheme == LIGHT_THEME_BCKG; } private static async Task LoadThemeFromSettingsAsync() @@ -73,22 +88,5 @@ private static async Task LoadThemeFromSettingsAsync() } private static async Task SaveThemeInSettingsAsync(ElementTheme theme) => await SettingsHelper.WriteAsync(SettingsKey, theme.ToString()); - - private static T GetThemeResource(ElementTheme theme, string resKey) - { - var isLightTheme = (theme == ElementTheme.Default) - ? (IsSystemThemeLight()) - : (theme == ElementTheme.Light); - var themeKey = isLightTheme ? "Light" : "Dark"; - var themeDictionary = (ResourceDictionary)Application.Current.Resources.ThemeDictionaries[themeKey]; - return (T)themeDictionary[resKey]; - } - - private static bool IsSystemThemeLight() - { - var DefaultTheme = new UISettings(); - var uiTheme = DefaultTheme.GetColorValue(UIColorType.Background).ToString(); - return uiTheme == LIGHT_THEME_BCKG; - } } } diff --git a/Yugen.Mosaic.Uwp/Strings/en-US/Resources.resw b/Yugen.Mosaic.Uwp/Strings/en-US/Resources.resw index 9d6eedb..1825bf9 100644 --- a/Yugen.Mosaic.Uwp/Strings/en-US/Resources.resw +++ b/Yugen.Mosaic.Uwp/Strings/en-US/Resources.resw @@ -118,38 +118,38 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Add images, Yugen Mosaic will use them as tiles to build your mosaic. More tiles you choose, better result you get! + Then add images. Yugen Mosaic will use them as tiles to build your mosaic. The more tiles you choose, the better result you will get! Create a list of tiles - Once you finished to setup all parameters, click and the app will start to create the mosaic for you. It can take more or less time according to your pc hardware and the parameters you set! + Now here is where Yugen Mosaic works its magic. Once you set all parameters, click ‘Create’ to start. The processing time is dependent on your pc hardware and on the parameters you set! - Create the mosaic. + Create the mosaic - Choose the master image you want to use as the matrix of the mosaic. Yugen Mosaic will create a mosaic as close as possible to this image. + First, choose the master image you want to use as the matrix of the mosaic. Yugen Mosaic will create a mosaic as close as possible to this image. Select the master image - Choose the type of mosaic: -- Classic: the app will automatically choose the best fitting image to apply in every tile. -- Random: the app will randomly choose between possible fitting images, it's faster than classic but less precise. -- Adjust Hue: the app will insert all the tiles you choose, adapting the color to the master image. -- Plain Color: the app will create a mosaic with plain colors, based on the master image, no tiles pictures needed. + Now choose the type of your mosaic: +- Choose "Classic" to automatically choose the best fitting image to apply in every tile. +- Choose "Random" to randomly choose images that have best possible fit. It is faster than Classic but less precise. +- Choose "Adjust Hue" to insert all the tiles you choose, adapting the color to the master image. +- Choose "Plain Color" to create a mosaic with plain colors based on the master image. You do not need to provide any images. - Mosaic type + Set the mosaic type - Choose the resolution of the final mosaic picture. + Next choose the resolution of the final mosaic picture. This will determine your art’s height and width. - Set the parameters of the Mosaic + Set the mosaic parameters This is the last step, if you like the result, you can click and save the mosaic picture on your device. @@ -158,9 +158,9 @@ Save the mosaic - After you have created your list of tiles, it is necessary to set all the mosaic parameters. Here you can set the size of every single tile, smaller size will give you a more detailed mosaic! + Next you can optionally set the mosaic’s tiles’ parameters. Afer you have created your list of tiles by adding your images, you can set the size of every single tile. The smaller the size the more detail your mosaic will have! - Tile properties + Set the tile properties \ No newline at end of file diff --git a/Yugen.Mosaic.Uwp/ViewModels/MainViewModel.cs b/Yugen.Mosaic.Uwp/ViewModels/MainViewModel.cs index c4167aa..dc13706 100644 --- a/Yugen.Mosaic.Uwp/ViewModels/MainViewModel.cs +++ b/Yugen.Mosaic.Uwp/ViewModels/MainViewModel.cs @@ -198,7 +198,7 @@ private async Task AddMasterImmageCommandBehavior() await MasterBpmSource.SetSourceAsync(outputStream); } - Tuple newSize = RatioHelper.Convert(image.Width, image.Height, OutputSize.Width, OutputSize.Height); + Tuple newSize = MathHelper.RatioConvert(image.Width, image.Height, OutputSize.Width, OutputSize.Height); OutputWidth = newSize.Item1; OutputHeight = newSize.Item2; } @@ -288,8 +288,8 @@ private async Task SaveCommandBehavior() var fileTypes = new Dictionary>() { - {FileFormat.Png.ToString(), new List() {FileFormat.Png.FileFormatToString()}}, - {FileFormat.Jpg.ToString(), new List() {FileFormat.Jpg.FileFormatToString()}} + {FileFormat.Png.ToString(), new List() {FileFormat.Png.GetStringRepresentation()}}, + {FileFormat.Jpg.ToString(), new List() {FileFormat.Jpg.GetStringRepresentation()}} }; StorageFile file = await FilePickerHelper.SaveFile("Mosaic", fileTypes, diff --git a/Yugen.Mosaic.Uwp/Yugen.Mosaic.Uwp.csproj b/Yugen.Mosaic.Uwp/Yugen.Mosaic.Uwp.csproj index c63014a..6f8aa79 100644 --- a/Yugen.Mosaic.Uwp/Yugen.Mosaic.Uwp.csproj +++ b/Yugen.Mosaic.Uwp/Yugen.Mosaic.Uwp.csproj @@ -131,13 +131,11 @@ - - - + - + MainPage.xaml @@ -160,7 +158,6 @@ -