VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
In This Topic
    Codecs: How to convert JPEG to JPEG2000?
    In This Topic
    VintaSoft Imaging .NET SDK allows to convert JPEG file to a JPEG2000 file using 2 ways: DocumentConverter or ImageCollection.
    Usage of DocumentConverter class provides the best performance because DocumentConverter class uses multi-threading.

    Here is C#/VB.NET code that shows how to convert JPEG image to JPEG2000 image using DocumentConverter class:
    /// <summary>
    /// Converts JPEG file to a JPEG2000 file using Vintasoft.Imaging.DocumentConverter class.
    /// </summary>
    public static void ConvertJpegToJpeg2000_DocumentConverter(string jpegFilename, string jpeg2000Filename)
    {
        Vintasoft.Imaging.DocumentConverter.Convert(jpegFilename, jpeg2000Filename);
    }
    
    ''' <summary>
    ''' Converts JPEG file to a JPEG2000 file using Vintasoft.Imaging.DocumentConverter class.
    ''' </summary>
    Public Shared Sub ConvertJpegToJpeg2000_DocumentConverter(jpegFilename As String, jpeg2000Filename As String)
        Vintasoft.Imaging.DocumentConverter.Convert(jpegFilename, jpeg2000Filename)
    End Sub
    


    Here is C#/VB.NET code that shows how to convert JPEG image to JPEG2000 image using VintasoftImage class:
    public static void ConvertJpegToJpeg2000_VintasoftImage(string jpegFilename, string jpeg2000Filename)
    {
        using (Vintasoft.Imaging.VintasoftImage image = 
            new Vintasoft.Imaging.VintasoftImage(jpegFilename))
        {
            using (Vintasoft.Imaging.Codecs.Encoders.Jpeg2000Encoder jpeg2000Encoder = 
                new Vintasoft.Imaging.Codecs.Encoders.Jpeg2000Encoder())
            {
                image.Save(jpeg2000Filename, jpeg2000Encoder);
            }
        }
    }
    
    Public Shared Sub ConvertJpegToJpeg2000_VintasoftImage(jpegFilename As String, jpeg2000Filename As String)
        Using image As New Vintasoft.Imaging.VintasoftImage(jpegFilename)
            Using jpeg2000Encoder As New Vintasoft.Imaging.Codecs.Encoders.Jpeg2000Encoder()
                image.Save(jpeg2000Filename, jpeg2000Encoder)
            End Using
        End Using
    End Sub