using System;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tango.RemoteDesktop.Encoders
{
///
/// Represents an PNG encoder.
///
///
public class PngEncoder : FrameEncoder
{
///
/// Initializes a new instance of the class.
///
/// The frame.
public PngEncoder(IFrame frame) : base(frame)
{
}
///
/// Returns a stream containing the encoded frame.
///
///
public override MemoryStream ToStream()
{
MemoryStream ms = new MemoryStream();
Frame.ToBitmap().Save(ms, ImageFormat.Png);
return ms;
}
}
}