naps2/NAPS2.Sdk/ImportExport/DirectImageTransfer.cs
2019-03-19 15:08:25 -04:00

26 lines
731 B
C#

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Google.Protobuf;
using NAPS2.Images;
using NAPS2.Serialization;
namespace NAPS2.ImportExport
{
[Serializable]
public class DirectImageTransfer
{
public DirectImageTransfer(IEnumerable<ScannedImage> images)
{
ProcessID = Process.GetCurrentProcess().Id;
var serializedImages = images.Select(x => SerializedImageHelper.Serialize(x, new SerializedImageHelper.SerializeOptions()));
SerializedImages = serializedImages.Select(x => x.ToByteArray()).ToList();
}
public int ProcessID { get; }
public List<byte[]> SerializedImages { get; }
}
}