c# - Loading an image in WP8 app on device -


i trying make simple application in have image have copied in assets folder of project. image got web, , in png format.

can body give me idea how can copy images project when deploy project on device able load them.

current trying is.

   var streamresource = app.getresourcestream(new uri("/assets/tiles/gradiant-mask.png", urikind.relative));                     using (stream stream = streamresource.stream) {                         var maskdata = new byte[stream.length];                         stream.read(maskdata, 0, maskdata.length); } 

but streamresource object null , may reason didn't find file on device. can body guide me how can load image on device in wp8 application.

make sure build action set content on properties of image file in visual studio.

if want build action set resource, use following uri syntax:

new uri("/your_project_name;component/assets/tiles/gradiant-mask.png", urikind.relative) 

using content build action recommended.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -