有什么办法可以在WP7上打开picturehub应用程序来查看照片吗?

发布于 2024-12-28 02:47:44 字数 220 浏览 0 评论 0原文

在我当前的应用程序中,我想使用 XNA MediaLibrary 类将图像保存到用户的图片中心文件夹中 - 这很容易......

但是,然后我想在 PictureHub 中打开该图片 - 特别是这样然后用户可以轻松分享该照片。

有人知道有什么办法可以做到这一点吗?到目前为止,我什么也没找到 - 我尝试了 MediaPlayerLauncher (但失败了 - 它确实是为音乐/视频而构建的)。

In my current app, I'd like to use the XNA MediaLibrary classes to save an image to the user's picture hub folders - that's easy enough...

However, then I'd like to open that picture in the PictureHub - especially so that the user can then easily share that photo.

Is there any way anyone knows to do this? I've looked and found nothing so far - and I tried MediaPlayerLauncher (but that failed - it's really built for music/video).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

嗫嚅 2025-01-04 02:47:44

实际上,您可以通过两种方式实现相同的目的,

  1. 通过使用 photoChooser Task

  2. 在应用程序中使用图像控件

1.PhotoChooserTask :

使用 Microsoft .电话.任务;使用此名称空间,

PhotoChooserTask objPhotoChooser = new PhotoChooserTask();
objPhotoChooser.Completed += new EventHandler<PhotoResult>(PhotoChooserCompleted);
objPhotoChooser.Show();

private void PhotoChooserCompleted(object sender, PhotoResult e) 
    { 
        if (e.TaskResult == TaskResult.OK) 
        { 
            var img = new BitmapImage(); 
            img.SetSource(e.ChosenPhoto); 
        } 
    } 

您可以使用 Cameracapture 任务将实时图片共享添加到您的应用程序。

2.在应用程序页面中使用图像控件

您必须在应用程序页面中使用图像控件来完成相同的任务。

page.xaml 看起来像

<Image x:Name = "imagecontrol" width ="300" height = "300" Stretch = "Fill">

添加这些命名空间

using Microsoft.Xna.Framework.Media;
using System.Windows.Media.Imaging;

在适当的处理程序中的 xaml.cs 文件中

MediaLibrary ml = new MediaLibrary();

if (ml.Pictures.Count > 0)
{
     System.IO.Stream sm = ml.Pictures[0].GetImage();
     BitmapImage bmp = new BitmapImage();
     bmp.SetSource(sm);
     imagecontrol.Source = bmp;
}

,这总是在 MediaLibrary 中设置第一张图片,根据您的要求更改此代码。

Actually you can achieve the same in 2 ways ,

  1. By using photoChooser Task

  2. Using Image control in you application

1.PhotoChooserTask :

using Microsoft.Phone.Tasks; use this name space

PhotoChooserTask objPhotoChooser = new PhotoChooserTask();
objPhotoChooser.Completed += new EventHandler<PhotoResult>(PhotoChooserCompleted);
objPhotoChooser.Show();

private void PhotoChooserCompleted(object sender, PhotoResult e) 
    { 
        if (e.TaskResult == TaskResult.OK) 
        { 
            var img = new BitmapImage(); 
            img.SetSource(e.ChosenPhoto); 
        } 
    } 

you can use the Cameracapture task to add real time picture sharing to you application.

2.Image control using in you applciation page

you have to use the Image control in you application page to accomplish the same.

page.xaml looks like

<Image x:Name = "imagecontrol" width ="300" height = "300" Stretch = "Fill">

Add these namespaces

using Microsoft.Xna.Framework.Media;
using System.Windows.Media.Imaging;

behind this code looks like in xaml.cs file in the appropriate hanlder

MediaLibrary ml = new MediaLibrary();

if (ml.Pictures.Count > 0)
{
     System.IO.Stream sm = ml.Pictures[0].GetImage();
     BitmapImage bmp = new BitmapImage();
     bmp.SetSource(sm);
     imagecontrol.Source = bmp;
}

This always set first picture in MediaLibrary, change this code according to your requirement.

蓝眼睛不忧郁 2025-01-04 02:47:44

上面的答案是从您的应用程序访问照片。

但您的想法是当用户单击图片中心上下文中可用的选项时从图片中心启动应用程序。

为此,您必须创建并声明您的应用程序作为图片中心的扩展应用程序,这可以通过以下方式实现:在以下链接中描述

或者链接在这里

http://msdn.microsoft.com/en-us /library/hh202966%28v=vs.92%29.aspx

Above answer is to access photos , from your application.

But your idea is to launch the application from the Picture hub when user clicks on the options available in the picture hub context.

To do so you have to create and declare your application as Extensions to picture hub application this can achieved in the way described in the following link

alternatively link is here

http://msdn.microsoft.com/en-us/library/hh202966%28v=vs.92%29.aspx

著墨染雨君画夕 2025-01-04 02:47:44

好吧...这已经开放了足够长的时间了。

Mango 7.1/7.5 级别的答案似乎是明确的“否”

OK... this has been open long enough.

The answer on Mango 7.1/7.5 level seems to be a clear "no"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文