check point
This commit is contained in:
18
framework/Inspectron.Camera/Image/Extensions.cs
Normal file
18
framework/Inspectron.Camera/Image/Extensions.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
|
||||
namespace Inspectron.Camera.Image
|
||||
{
|
||||
public static class Extensions
|
||||
{
|
||||
public static ByteImage ToByteImage(this Bitmap self,int channels)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream();
|
||||
var bmp = self;
|
||||
bmp.Save(ms, ImageFormat.Bmp);
|
||||
ByteImage bi = new ByteImage(bmp.Width, bmp.Height, channels, ms.ToArray(), bmp.Width);
|
||||
return bi;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user