XmpBasicPackage.ContainsKey

XmpBasicPackage.ContainsKey method

Determines whether the specified key contains key.

public override bool ContainsKey(string key)
ParameterTypeDescription
keyStringThe key to be checked.

Return Value

Returns true if the specified key contains key.

Examples

The following code demonstrates the using UpdateMetadata option to update CreatorTool value in xmp data.

[C#]

string path = "output.psd";

using (var image = new PsdImage(100, 100))
{
    // If you want the creator tool to change, make sure that the "UpdateMetadata" property is set to true. It's set to true by default.
    var psdOptions = new PsdOptions();
    psdOptions.UpdateMetadata = true;

    // Saving the image. 
    image.Save(path, psdOptions);

    // Checking creator tool in code.
    var xmpData = image.XmpData;
    var basicPackage = image.XmpData.GetPackage(Namespaces.XmpBasic);

    // Here will be updated creator tool info.
    var currentCreatorTool = (string)basicPackage[":CreatorTool"];
}

See Also