blob: 18d1445184f4ecb42599fad617cca1d4d8a7f634 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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
{
/// <summary>
/// Represents an <see cref="IFrame"/> BMP encoder.
/// </summary>
/// <seealso cref="Tango.RemoteDesktop.FrameEncoder" />
public class BitmapEncoder : FrameEncoder
{
/// <summary>
/// Initializes a new instance of the <see cref="BitmapEncoder"/> class.
/// </summary>
/// <param name="frame">The frame.</param>
public BitmapEncoder(IFrame frame) : base(frame)
{
}
/// <summary>
/// Returns a stream containing the encoded frame.
/// </summary>
/// <returns></returns>
public override MemoryStream ToStream()
{
MemoryStream ms = new MemoryStream();
Frame.ToBitmap().Save(ms, ImageFormat.Bmp);
return ms;
}
}
}
|