VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
Vintasoft.Imaging.Codecs.ImageFiles.Png Namespace / PngPage Class / GetTextualInformation() Method
Syntax Example Requirements SeeAlso
In This Topic
    GetTextualInformation() Method (PngPage)
    In This Topic
    Returns a textual information of this page.
    Syntax

    Return Value

    Textual information of this page as dictionary.
    Example

    Here is an example that shows how to change the creation date of PNG file:

    
    ''' <summary>
    ''' Sets the creation time of PNG file.
    ''' </summary>
    ''' <param name="filename">The filename.</param>
    ''' <param name="creationDate">The creation date of file.</param>
    Public Shared Sub SetCreationTime(filename As String, creationDate As System.DateTime)
        ' open PNG file
        Using pngFile As New Vintasoft.Imaging.Codecs.ImageFiles.Png.PngFile(filename)
            Dim page As Vintasoft.Imaging.Codecs.ImageFiles.Png.PngPage = pngFile.Page
    
            ' get the textual information of image
            Dim textualInformation As System.Collections.Generic.Dictionary(Of String, String) = page.GetTextualInformation()
    
            ' add the creation date to the textual information
            textualInformation("Creation Time") = creationDate.ToString("yyyy:MM:dd hh:mm:ss", System.Globalization.CultureInfo.InvariantCulture)
            ' set textual information of image
            page.SetTextualInformation(textualInformation)
    
            ' save changes in PNG file
            pngFile.SaveChanges()
        End Using
    End Sub
    
    
    
    /// <summary>
    /// Sets the creation time of PNG file.
    /// </summary>
    /// <param name="filename">The filename.</param>
    /// <param name="creationDate">The creation date of file.</param>
    public static void SetCreationTime(string filename, System.DateTime creationDate)
    {
        // open PNG file
        using (Vintasoft.Imaging.Codecs.ImageFiles.Png.PngFile pngFile = 
            new Vintasoft.Imaging.Codecs.ImageFiles.Png.PngFile(filename))
        {
            Vintasoft.Imaging.Codecs.ImageFiles.Png.PngPage page = pngFile.Page;
    
            // get the textual information of image
            System.Collections.Generic.Dictionary<string, string> textualInformation = page.GetTextualInformation();
            
            // add the creation date to the textual information
            textualInformation["Creation Time"] = creationDate.ToString("yyyy:MM:dd hh:mm:ss", 
                System.Globalization.CultureInfo.InvariantCulture);
            // set textual information of image
            page.SetTextualInformation(textualInformation);
    
            // save changes in PNG file
            pngFile.SaveChanges();
        }
    }
    
    

    Requirements

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

    See Also