mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
708 B
24 lines
708 B
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace ImageSharp.Tests.TestUtilities.Integration
|
|
{
|
|
using System.IO;
|
|
|
|
using ImageSharp.Formats;
|
|
using ImageSharp.PixelFormats;
|
|
|
|
public class ReferencePngEncoder : IImageEncoder
|
|
{
|
|
public static ReferencePngEncoder Instance { get; } = new ReferencePngEncoder();
|
|
|
|
public void Encode<TPixel>(Image<TPixel> image, Stream stream)
|
|
where TPixel : struct, IPixel<TPixel>
|
|
{
|
|
using (System.Drawing.Bitmap sdBitmap = IntegrationTestUtils.ToSystemDrawingBitmap(image))
|
|
{
|
|
sdBitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|