如何将.tff图像转换为CCITT4格式

时间:2017-02-15 09:27:20

标签: c# asp.net image

我成功获得了新图像,但我无法获得原始图像,图像被裁剪 这是我试过的代码:

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();
    }
}     

0 个答案:

没有答案