locked
Bitmap Sharing using Share Contract in Metro app RRS feed

  • Question

  • I want to share a bitmap image by using Share contract, I have tried it in a way that I made  my application as share source, but I have no idea how to set window 8 EMail as my Share target app, so I can send image as an attachment? 
    Tuesday, April 17, 2012 8:03 AM

Answers

  • In general the best solution is to provide the data in as many formats as make sense. If you include the image as both a bitmap and a file then the share target app can use whichever makes the most sense for it.

    Your share source can't pick which share target the user will use with it: the user may have several email apps which they want to use and different apps may have different requirements. Including multiple data types is the best way to cover them all.

    You can confirm that your app works with specific targets by testing or by cracking the target app's appxmanifest to see what <sharetarget>s it supports.

    --Rob

    Tuesday, April 17, 2012 11:05 PM
    Moderator

All replies

  • Hi Moobila,

    Your app doesn't control what the Share target is. That is up to the user. Your app would declare and implement the share source contract. When the user picks the sharing charm for your app, the app will receive a DataRequested event. It can then place the image in its DataRequest. The system will then let the user choose to Share what your app provided with any apps which can handle that data type.

    See the Sharing content source app sample for an example.

    --Rob

    Tuesday, April 17, 2012 8:10 AM
    Moderator
  • I have implemented the share source contract in the same as mention on the link, the problem here is that I want to share image using Email metro app as an  attachment, but when open the share charm Email is not listed here, please tell me how I can identify which type of data is supported by the target share apps. 
    Tuesday, April 17, 2012 8:40 AM
  • hi,

    I want to send an image from app as attachment using share contract through Email app (share target app), plz guide me I can do it ?

    Tuesday, April 17, 2012 2:05 PM
  • Tuesday, April 17, 2012 2:14 PM
  • In general the best solution is to provide the data in as many formats as make sense. If you include the image as both a bitmap and a file then the share target app can use whichever makes the most sense for it.

    Your share source can't pick which share target the user will use with it: the user may have several email apps which they want to use and different apps may have different requirements. Including multiple data types is the best way to cover them all.

    You can confirm that your app works with specific targets by testing or by cracking the target app's appxmanifest to see what <sharetarget>s it supports.

    --Rob

    Tuesday, April 17, 2012 11:05 PM
    Moderator