From 0dcd742a3c35527386a93e1b1ef761c2aeff8308 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Mon, 2 Mar 2020 23:30:34 +0200 Subject: Implemented Tango.RemoteDesktop. Implemented png 8 bit quantization. Implemented RasterFrame bounds clipping. Refactored VectorFrame to use indexed colors. --- .../Tango.RemoteDesktop/Encoders/BitmapEncoder.cs | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Software/Visual_Studio/Tango.RemoteDesktop/Encoders/BitmapEncoder.cs (limited to 'Software/Visual_Studio/Tango.RemoteDesktop/Encoders/BitmapEncoder.cs') diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/Encoders/BitmapEncoder.cs b/Software/Visual_Studio/Tango.RemoteDesktop/Encoders/BitmapEncoder.cs new file mode 100644 index 000000000..18d144518 --- /dev/null +++ b/Software/Visual_Studio/Tango.RemoteDesktop/Encoders/BitmapEncoder.cs @@ -0,0 +1,36 @@ +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 BMP encoder. + /// + /// + public class BitmapEncoder : FrameEncoder + { + /// + /// Initializes a new instance of the class. + /// + /// The frame. + public BitmapEncoder(IFrame frame) : base(frame) + { + } + + /// + /// Returns a stream containing the encoded frame. + /// + /// + public override MemoryStream ToStream() + { + MemoryStream ms = new MemoryStream(); + Frame.ToBitmap().Save(ms, ImageFormat.Bmp); + return ms; + } + } +} -- cgit v1.3.1