VintaSoft Imaging .NET SDK 15.1: Documentation for .NET developer
Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000 Namespace / Jpeg2000Page Class / IccProfile Property
Syntax Example Requirements SeeAlso
In This Topic
    IccProfile Property (Jpeg2000Page)
    In This Topic
    Gets or sets the byte array with copy of ICC profile data.
    Syntax
    'Declaration
    
    Public Property IccProfile As Byte[]
    
    
    public byte[] IccProfile { get; set; }
    
    
    public: __property byte[] get_IccProfile();
    public: __property void set_IccProfile(
    byte[]* value
    );
    public:
    property byte[] IccProfile { byte[] get(); void set(array<byte>^ value); }

    Property Value

    Byte array with copy of ICC profile data if JPEG2000 page has ICC profile; null if JPEG2000 page does not have ICC profile.
    Example

    This C#/VB.NET code shows how to add ICC-profile to a JPEG2000 page.

    
    ''' <summary>
    ''' Adds ICC-profile to a JPEG2000 image using Jpeg2000Page class.
    ''' </summary>
    ''' <param name="inputJpeg2000Filename">The name of input JPEG2000 file.</param>
    ''' <param name="iccProfileFilename">The name of ICC-profile.</param>
    ''' <param name="outputJpeg2000Filename">The name of output JPEG2000 file.</param>
    Public Shared Sub AddIccProfileToJpeg2000Page(inputJpeg2000Filename As String, iccProfileFilename As String, outputJpeg2000Filename As String)
        ' open an existing JPEG2000 file
        Using jpeg2000File As New Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000File(inputJpeg2000Filename)
            ' get JPEG2000 page
            Dim jpeg2000Page As Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000Page = jpeg2000File.Page
    
            ' read bytes of ICC-profile from file
            Dim iccProfile As Byte() = System.IO.File.ReadAllBytes(iccProfileFilename)
            ' add ICC-profile to a JPEG2000 page
            jpeg2000Page.IccProfile = iccProfile
    
            ' save JPEG2000 file to a new file
            jpeg2000File.Save(outputJpeg2000Filename)
        End Using
    End Sub
    
    
    
    /// <summary>
    /// Adds ICC-profile to a JPEG2000 image using Jpeg2000Page class.
    /// </summary>
    /// <param name="inputJpeg2000Filename">The name of input JPEG2000 file.</param>
    /// <param name="iccProfileFilename">The name of ICC-profile.</param>
    /// <param name="outputJpeg2000Filename">The name of output JPEG2000 file.</param>
    public static void AddIccProfileToJpeg2000Page(string inputJpeg2000Filename, string iccProfileFilename, string outputJpeg2000Filename)
    {
        // open an existing JPEG2000 file
        using (Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000File jpeg2000File = 
            new Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000File(inputJpeg2000Filename))
        {
            // get JPEG2000 page
            Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000.Jpeg2000Page jpeg2000Page = jpeg2000File.Page;
    
            // read bytes of ICC-profile from file
            byte[] iccProfile = System.IO.File.ReadAllBytes(iccProfileFilename);
            // add ICC-profile to a JPEG2000 page
            jpeg2000Page.IccProfile = iccProfile;
    
            // save JPEG2000 file to a new file
            jpeg2000File.Save(outputJpeg2000Filename);
        }
    }
    
    

    Requirements

    Target Platforms: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also