[Windows Phone 7] developing a plug-in for sharing images (1)

Source: Internet
Author: User
In picture hub of WP7, select an image and click "…" when viewing the image. Menu, click extras... 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: In your application Program Create a New XML file named "extras. xml" with the following content: <? XML version = "1.0" encoding = "UTF-8"?> <Extras> <Photosextrasapplication> <Enabled> true </enabled> </Photosextrasapplication> </extras> so that your application will appear in extras... but how to process the selected image, in fact, from extras... when starting your application, the image will be passed to your application through the navigation parameter "token. an example of this image is as follows: 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 ); // The selected image is saved in piclibrayimage. You can process piclibrayimage as needed. // Todo: } }
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.