public void BasicTest(double dpi, double fgScale, string bg, string fg, int exWidth, int exHeight) { var info = new ResizeImageInfo(); info.Filename = "images/" + bg; info.ForegroundFilename = "images/" + fg; info.ForegroundScale = fgScale; info.IsAppIcon = true; var tools = new SkiaSharpAppIconTools(info, Logger); var dpiPath = new DpiPath("", (decimal)dpi); tools.Resize(dpiPath, DestinationFilename); AssertFileSize(DestinationFilename, exWidth, exHeight); }
public void BasicTest(double dpi, double fgScale, string bg, string fg) { var info = new SharedImageInfo(); info.Filename = "images/" + bg; info.ForegroundFilename = "images/" + fg; info.ForegroundScale = fgScale; info.IsAppIcon = true; var tools = new SkiaSharpAppIconTools(info, Logger); var dpiPath = new DpiPath("", (decimal)dpi); tools.Resize(dpiPath, DestinationFilename); //File.Copy(DestinationFilename, $"output-{dpi}-{fgScale}-{bg}-{fg}.png", true); }
public void DiffPropoprtionWithoutBaseUseBackgroundSize(double dpi, double fgScale, string bg, string fg, int exWidth, int exHeight) { var info = new ResizeImageInfo { Filename = "images/" + bg, ForegroundFilename = "images/" + fg, ForegroundScale = fgScale, IsAppIcon = true, Color = SKColors.Orange, }; var tools = new SkiaSharpAppIconTools(info, Logger); var dpiPath = new DpiPath("", (decimal)dpi); tools.Resize(dpiPath, DestinationFilename); AssertFileSize(DestinationFilename, exWidth, exHeight); AssertFileMatches(DestinationFilename, new object[] { dpi, fgScale, bg, fg }); }