小编Cas*_*ius的帖子

如何在通用应用程序[UWP]中编写XMP"People Tagged"

使用WIC,我可以编写有关标记人员的 xmp信息: 人员标记概述

现在我试图在UWP中做同样的事情,但它不起作用:

当我尝试只更改像"/ xmp/Title"这样的简单标签时,它正在工作.

但是当我尝试更改"PersonDisplayName"或"Rectangle"时,它无法正常工作.

代码示例:

public async void SaveNewPeopleTagged(StorageFile file, string name , string rect)
    {
        try
        {
            using (IRandomAccessStream fileStream = await file.OpenAsync(FileAccessMode.ReadWrite),
                                       memStream = new InMemoryRandomAccessStream())
            {
                BitmapDecoder decoder = await BitmapDecoder.CreateAsync(fileStream);

                // Set the encoder's destination to the temporary, in-memory stream.
                BitmapEncoder encoder = await BitmapEncoder.CreateForTranscodingAsync(memStream, decoder);

                var propertySet = new Windows.Graphics.Imaging.BitmapPropertySet();

                BitmapTypedValue btName = new BitmapTypedValue(name, Windows.Foundation.PropertyType.String);
                //"/xmp/<xmpstruct>MP:RegionInfo/<xmpbag>MPRI:Regions/PersonDisplayName" **is not working**
                propertySet.Add("/xmp/RegionInfo/Regions/PersonDisplayName", btName);

                BitmapTypedValue btRect = new BitmapTypedValue(rect, Windows.Foundation.PropertyType.String);
                //"/xmp/<xmpstruct>MP:RegionInfo/<xmpbag>MPRI:Regions/Rectangle" **is not …
Run Code Online (Sandbox Code Playgroud)

xmp win-universal-app

5
推荐指数
1
解决办法
226
查看次数

标签 统计

win-universal-app ×1

xmp ×1