In picture hub of WP7, select an image and click "…" when viewing the image. Menu, click share... A menu appears (this menu shows the list of applications that can share or process the selected image)
The following describes how to implement this one-click Sharing function: 1. Create a share picker XML file. 2. obtain and process images in your application. Program Create an XML file named "E0F0E49A-3EB1-4970-B780-45DA41EC7C28.xml". Note: Copy to output directory attributes are set Copy always . In this way, your application will appear in share... but how to process the selected image, in fact, from share... when you start your application, the image will be passed to your application through the navigation parameter "fileid. the following is an example of the image:
protected override void onnavigatedto (navigationeventargs e) {// get a dictionary of query string keys and values. idictionary
querystrings = This. navigationcontext. querystring; // ensure that there is at least one key in the query string, and check // if the "fileid" Key is present. if (querystrings. containskey ("fileid") {// retrieve the picture from the local Zune media database using the fileid // passed to the application. medialibrary library = new medialibrary (); picture = library. getpicturefromtoken (querystrings ["fileid"]); // create a writeablebitmap object and add it to the image control source property. bitmapimage bitmap = new bitmapimage (); bitmap. setsource (picture. getimage (); writeablebitmap piclibraryimage = new writeablebitmap (Bitmap); retrievepic. source = piclibraryimage ;}}