VintaSoft Imaging .NET SDK 15.1: Документация для .NET разработчика
Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000 Namespace / Jpeg2000File Class
Члены типа Объект Синтаксис Example Иерархия Требования Смотрите также
В этом разделе
Класс Jpeg2000File
В этом разделе
Предоставляет низкоуровневые функции для управления файлом JPEG2000.
Объектная модель
Jpeg2000Page ImageFileSource Jpeg2000File
Синтаксис
Пример

Вот C#/VB.NET код, который демонстрирует, как преобразовать JPEG файл2000 в TIFF файл.


' Converts Jpeg2000 file to Tiff file.
Public Shared Sub ConvertJpeg2000ToTiff(jpeg2000Filename As String, tiffFilename As String)
    Using stream As New System.IO.FileStream(jpeg2000Filename, System.IO.FileMode.Open, System.IO.FileAccess.Read)
        If Not Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000File.IsValidFormat(stream) Then
            Throw New System.ApplicationException()
        End If

        Dim image As Vintasoft.Imaging.VintasoftImage

        Using file As New Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000File(stream)
            image = file.Page.GetImage()
        End Using

        Dim tiffEncoder As New Vintasoft.Imaging.Codecs.Encoders.TiffEncoder()

        image.Save(tiffFilename, tiffEncoder)

        tiffEncoder.Dispose()

        image.Dispose()
    End Using
End Sub


// Converts Jpeg2000 file to Tiff file.
public static void ConvertJpeg2000ToTiff(string jpeg2000Filename, string tiffFilename)
{
    using (System.IO.FileStream stream = new System.IO.FileStream(
        jpeg2000Filename, System.IO.FileMode.Open, System.IO.FileAccess.Read))
    {
        if (!Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000File.IsValidFormat(stream))
        {
            throw new System.ApplicationException();
        }

        Vintasoft.Imaging.VintasoftImage image;

        using (Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000File file =
            new Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000File(stream))
        {
            image = file.Page.GetImage();
        }

        Vintasoft.Imaging.Codecs.Encoders.TiffEncoder tiffEncoder =
            new Vintasoft.Imaging.Codecs.Encoders.TiffEncoder();

        image.Save(tiffFilename, tiffEncoder);

        tiffEncoder.Dispose();

        image.Dispose();
    }
}

Иерархия наследования
Требования

Целевые платформы: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

Смотрите также