Struct PngTextData
- Namespace
- SixLabors.ImageSharp.Formats.Png.Chunks
- Assembly
- SixLabors.ImageSharp.dll
Stores text data contained in the iTXt, tEXt, and zTXt chunks. Used for conveying textual information associated with the image, like the name of the author, the copyright information, the date, where the image was created, or some other information.
public readonly struct PngTextData : IEquatable<PngTextData>
- Implements
- Inherited Members
Constructors
PngTextData(string, string, string, string)
Initializes a new instance of the PngTextData struct.
public PngTextData(string keyword, string value, string languageTag, string translatedKeyword)
Parameters
keyword
stringThe keyword of the property.
value
stringThe value of the property.
languageTag
stringAn optional language tag.
translatedKeyword
stringA optional translated keyword.
Properties
Keyword
Gets the keyword of this PngTextData which indicates the type of information represented by the text string as described in https://www.w3.org/TR/PNG/#11keywords.
public string Keyword { get; }
Property Value
Examples
Typical properties are the author, copyright information or other meta information.
LanguageTag
Gets an optional language tag defined in https://www.w3.org/TR/PNG/#2-RFC-3066 indicates the human language used by the translated keyword and the text. If the first word is two or three letters long, it is an ISO language code https://www.w3.org/TR/PNG/#2-ISO-639.
public string LanguageTag { get; }
Property Value
Examples
Examples: cn, en-uk, no-bok, x-klingon, x-KlInGoN.
TranslatedKeyword
Gets an optional translated keyword, should contain a translation of the keyword into the language indicated by the language tag.
public string TranslatedKeyword { get; }
Property Value
Value
Gets the value of this PngTextData.
public string Value { get; }
Property Value
Methods
Equals(PngTextData)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(PngTextData other)
Parameters
other
PngTextDataAn object to compare with this object.
Returns
- bool
True if the current object is equal to the
other
parameter; otherwise, false.
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
Operators
operator ==(PngTextData, PngTextData)
Compares two PngTextData objects. The result specifies whether the values of the properties of the two PngTextData objects are equal.
public static bool operator ==(PngTextData left, PngTextData right)
Parameters
left
PngTextDataThe PngTextData on the left side of the operand.
right
PngTextDataThe PngTextData on the right side of the operand.
Returns
- bool
True if the current left is equal to the
right
parameter; otherwise, false.
operator !=(PngTextData, PngTextData)
Compares two PngTextData objects. The result specifies whether the values of the properties of the two PngTextData objects are unequal.
public static bool operator !=(PngTextData left, PngTextData right)
Parameters
left
PngTextDataThe PngTextData on the left side of the operand.
right
PngTextDataThe PngTextData on the right side of the operand.
Returns
- bool
True if the current left is unequal to the
right
parameter; otherwise, false.