Unable to play Sprite Images with aspect ratio in Windows Phone 8 -


i trying play sprite images on windows phone 8. not playing correctly, if single sprite image larger screen dimensions. try reduce image aspect ratio using rectangle , imagebrush. still facing same problem. please find below scenario.

scenario : sprite width/height : 22100 / 516

single sprite width/height : 850/516

mobile dimensions : 800/480

could can me out.

so, if understood question, need is:

  1. create bitmapimage, don't use imagebrush or rectangle..

    bitmapimage bitmapimage = new bitmapimage(); bitmapimage.urisource = new uri(imagepathorurl, urikind.relativeorabsolute); 
  2. i suggest add instruction prevent memory issues:

    bitmapimage.decodepixelwidth = imagewidth;  
  3. add bitmapimage image control , set **stretch** property aspect ratio:

    image img = new image(); img.source=bitmapimage; img.stretch = stretch.uniform; 

stretch property has other values, sure test other values see value adapts better needs.

let me know if works!


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -