惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Help Net Security
Help Net Security
G
Google Developers Blog
雷峰网
雷峰网
WordPress大学
WordPress大学
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Engineering at Meta
Engineering at Meta
Security Latest
Security Latest
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
F
Full Disclosure
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
J
Java Code Geeks
U
Unit 42
C
Cyber Attacks, Cyber Crime and Cyber Security
V
V2EX
C
Cisco Blogs
博客园 - 司徒正美
Project Zero
Project Zero
L
LINUX DO - 热门话题
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
Scott Helme
Scott Helme
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog
S
Securelist
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
G
GRAHAM CLULEY
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyberwarzone
Cyberwarzone
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
T
Threatpost
Recorded Future
Recorded Future
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
The Register - Security
The Register - Security
S
Security Archives - TechRepublic
博客园 - Franky
N
News | PayPal Newsroom
Simon Willison's Weblog
Simon Willison's Weblog
S
SegmentFault 最新的问题
W
WeLiveSecurity
A
Arctic Wolf
B
Blog

博客园 - 十二号的国王

【iOS开发】在ARC项目中使用非ARC文件 实现ZUNE上软件商城的软件星级推荐效果 [Windows Phone 7]开发分享图片的插件(2) [Windows Phone 7]如何判断手机是否有网络连接 [Windows Phone 7]如何导航页面和页面间传值 [Windows Phone 7]UI对屏幕的自适应的处理 [Windwos Phone 7] Accelerometer - 十二号的国王 [Windwos Phone 7] 获取设备相关信息 [Windows Phone 7] 常用资源(转) [Windows Phone 7] Storage XNA:保存数据到文件和从文件读取数据 XNA项目运行错误:No suitable graphics card found. POOM(Pocket Outlook Object Model)开发介绍及应用(转) 剪贴板剪切/复制与粘贴文件+1个待解决的问题 c#枚举-Enum C#读写INI配置文件(转) C#3.0新增特性 - 十二号的国王 关于DBNull vs 快捷键 - 十二号的国王
[Windows Phone 7]开发分享图片的插件(1)
十二号的国王 · 2011-03-03 · via 博客园 - 十二号的国王

在WP7的picture hub中,选中一张图片,查看图片时,点击“…”菜单,点extras…时,会出现一个菜单(这个菜单中就是可以对选中的图片进行分享或者处理的应用列表)

下面介绍如何实现这个一键分享功能:

在你的应用程序中新建一个叫“Extras.xml”的XML文件,里面的内容如下:

<?xml version="1.0" encoding="utf-8" ?>

<Extras>

 

 <PhotosExtrasApplication>

 

 </PhotosExtrasApplication>

</Extras>

这样你的应用就会出现在extras...中了,但是如何处理选中的图片了,实际上,从extras...中启动你的应用时,图片会通过导航参数“token”传递给你的应用程序.

得到该图片示例如下:

protected override void OnNavigatedTo(NavigationEventArgs e)

 

           if (NavigationContext.QueryString.ContainsKey("token"))

 

               MediaLibrary library = new MediaLibrary();

 

               Picture picture = library.GetPictureFromToken(NavigationContext.QueryString["token"]);

 

               BitmapImage bitmap = new BitmapImage();

 

               bitmap.SetSource(picture.GetImage());

 

               WriteableBitmap picLibraryImage = new WriteableBitmap(bitmap);

 

               //选中的图片就存在picLibrayImage中了,根据你的需要来处理picLibrayImage就行了