// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // using ImageSharp.Formats; namespace ImageSharp.Tests { using ImageSharp.PixelFormats; using Xunit; public class BmpEncoderTests : FileTestBase { public static readonly TheoryData BitsPerPixel = new TheoryData { BmpBitsPerPixel.Pixel24, BmpBitsPerPixel.Pixel32 }; [Theory] [MemberData(nameof(BitsPerPixel))] public void BitmapCanEncodeDifferentBitRates(BmpBitsPerPixel bitsPerPixel) { string path = this.CreateOutputDirectory("Bmp"); foreach (TestFile file in Files) { string filename = file.GetFileNameWithoutExtension(bitsPerPixel); using (Image image = file.CreateImage()) { image.Save($"{path}/{filename}.bmp", new BmpEncoderOptions { BitsPerPixel = bitsPerPixel }); } } } } }