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:
create
bitmapimage
, don't useimagebrush
orrectangle
..bitmapimage bitmapimage = new bitmapimage(); bitmapimage.urisource = new uri(imagepathorurl, urikind.relativeorabsolute);
i suggest add instruction prevent memory issues:
bitmapimage.decodepixelwidth = imagewidth;
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
Post a Comment