我成功获得了新图像,但我无法获得原始图像,图像被裁剪 这是我试过的代码:
private byte[] ConvertToCCITT4(byte[] input)
{
MemoryStream memoryStream1 = new MemoryStream(input);
RasterCodecs.CodecsPath = new FileInfo(Assembly.GetExecutingAssembly().Location).DirectoryName;
RasterCodecs rasterCodecs = new RasterCodecs();
using (IRasterImage irasterImage = rasterCodecs.Load((Stream)memoryStream1))
{
MemoryStream memoryStream2 = new MemoryStream();
rasterCodecs.Save(irasterImage, (Stream)memoryStream2, (RasterImageFormat)29, 1);
return memoryStream2.ToArray();
}
}