📷 A modern, cross-platform, 2D Graphics library for .NET
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
733 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, IEncoderOptions options)
where TPixel : struct, IPixel<TPixel>
{
using (System.Drawing.Bitmap sdBitmap = IntegrationTestUtils.ToSystemDrawingBitmap(image))
{
sdBitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
}
}
}
}