gpt4 book ai didi

c# - 分享一张图片只显示两个选项,Mail 和 Onenote

转载 作者:行者123 更新时间:2023-11-30 23:16:42 25 4
gpt4 key购买 nike

我想在本地分享一张图片,我正在像这样检索它 enter image description here

但是如果我调用

DataTransferManager.ShowShareUI();

我只有两个选择。但是在照片应用程序中,当我分享照片时,我会看到所有兼容的应用程序,比如 Instagram。但是我的应用程序只有两个。 enter image description here

知道如何获得这样的所有选项吗? enter image description here

最佳答案

看起来您的代码只共享实际位图:

req.data.SetBitmap(rasr)

在您安装的应用程序中,只有 Mail 和 OneNote 知道如何处理位图。这很常见,许多共享目标将接受 bitmap file但不是位图本身。参见 How to share files

// Because we are making async calls in the DataRequested event handler,
// we need to get the deferral first.
DataRequestDeferral deferral = req.GetDeferral();

// Make sure we always call Complete on the deferral.
try
{
StorageFile logoFile =
await Package.Current.InstalledLocation.GetFileAsync("Assets\\beautiful_folder\\and_a_beautiful_file.jpg");
List<IStorageItem> storageItems = new List<IStorageItem>();
storageItems.Add(logoFile);
req.Data.SetStorageItems(storageItems);
}
finally
{
deferral.Complete();
}

关于c# - 分享一张图片只显示两个选项,Mail 和 Onenote,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41905429/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com