Exemple #1
0
        public static void FinishSheets()
        {
            if (Settings.DeveloperMode)
            {
                for (int i = 0; i < Sheets.Length; i++)
                {
                    var sheet = Sheets[i];
                    if (sheet == null)
                    {
                        break;
                    }

                    BitmapSaver.Save($"{FileExplorer.Logs}spritesheet_{i}.png", TextureManager.GetContent(sheet.TextureID, sheet.Size, sheet.Size), sheet.Bounds);
                }
            }

            SheetBuilder.Clear();

            sheetsLoaded = true;
        }
        public void Save_ShouldThrow_WhenIncorrectPath()
        {
            Action act = () => BitmapSaver.Save(new Bitmap(100, 100), "png", "blablapath");

            act.Should().Throw <ArgumentException>();
        }
        public void Save_ShouldThrow_WhenIncorrectFormat()
        {
            Action act = () => BitmapSaver.Save(new Bitmap(100, 100), "jpga");

            act.Should().Throw <ArgumentException>();
        }
 public void Save_ShouldThrow_WhenIncorrectPath()
 {
     BitmapSaver.Save(new Bitmap(100, 100), "png", "blablapath").IsSuccess.Should().BeFalse();
 }
 public void Save_ShouldThrow_WhenIncorrectFormat()
 {
     BitmapSaver.Save(new Bitmap(100, 100), "jpga").IsSuccess.Should().BeFalse();
 }