0

I have an jpg file that is added in VS project within images folder. I can access its path using following

var imagePath = "ms-appx:///images/BookTitle.jpg";

I want to use this image in my app share contract. For this I am following the tutorial at this link. Only issue is that in the tutorial file is selected using filePicker whereas I already have this file within my project. I think I need to use following code but don't know how to set imageFile from imagePath above. Can you please provide any points?

request.data.setBitmap(Windows.Storage.Streams.RandomAccessStreamReference.createFromFile(imageFile));

Any pointer, how

1 Answer 1

2

Try

request.data.setBitmap(Windows.Storage.Streams.RandomAccessStreamReference.createFromUri(imagePath));
1
  • It seems to me that createFromFile takes an IStorageFile.
    – kirelagin
    Commented Jun 7, 2013 at 23:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.