XmpBasicPackage.SetValue

XmpBasicPackage.SetValue method

Sets the value.

public override void SetValue(string key, IXmlValue value)
ParameterTypeDescription
keyStringThe string representation of key that is identified with added value.
valueIXmlValueThe value to add to.

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