VintaSoft Imaging .NET SDK 15.1: Документация для .NET разработчика
Vintasoft.Imaging.Codecs.ImageFiles.Jpeg2000 Namespace / Jpeg2000Page Class / IccProfile Property
Синтаксис Example Требования Смотрите также
В этом разделе
    IccProfile Свойство (Jpeg2000Page)
    В этом разделе
    Возвращает или задает массив байтов с копией данных профиля ICC.
    Синтаксис
    '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

    Массив байтов с копией данных профиля ICC, если страница JPEG2000 имеет профиль ICC; null, если страница JPEG2000 не имеет профиля ICC.
    Пример

    Этот C#/VB.NET код показывает, как добавить ICC-профиль на страницу JPEG2000.

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

    Требования

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

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