/// <summary> /// Get a value of a metadata item. /// </summary> /// <param name="img"></param> /// <param name="name"></param> /// <param name="defaultValue"></param> /// <param name="i"></param> /// <param name="j"></param> /// <returns></returns> public string GetMeta(Pi2Image img, string name, string defaultValue, int i = 0, int j = 0) { Pi2Value value = NewString(); PiLib.RunAndCheck(Handle, $"getmeta({img.Name}, {name}, {value.Name}, {i}, {j}, {defaultValue})"); return(value.AsString()); }
/// <summary> /// Retrieves list of metadata item keys. /// </summary> /// <param name="img"></param> /// <returns></returns> public string[] ListMeta(Pi2Image img) { Pi2Value value = NewString(); PiLib.RunAndCheck(Handle, $"listmeta({img.Name}, {value.Name})"); string s = value.AsString(); if (String.IsNullOrEmpty(s)) { return(new string[0]); } return(s.Split(new string[] { ", " }, StringSplitOptions.None)); }