1

I would like to be able to add an image to a live tile so that there is no stretching and the image looks normal. I am getting my images from the PhotoChooserTask, which contain images from the medialibrary. As of now I can successfully place an image on a live tile, but it is stretched and the aspect ratio is not correct. How would I be able to find the aspect ratio of the image and crop the image so that it ends up being a square with dimensions 173x173 with no streching? I have followed a couple tutorials found online but nothing seems to accomplish this the way I need it to.

Matthew
  • 3,976
  • 15
  • 66
  • 130
  • Load up the image into a WriteableBitmap, and take out a 173x173 chunk from the image (and remember the user might have an image smaller than that!) – William Melani Aug 20 '12 at 22:19
  • Well, I guess how would I accomplish that is my question. I understand how to resize the image, but assuming that most images will have a 4:3 aspect ratio, and the smallest size is resized to 173, how would i crop the other side (equally on both ends) so that the size also is 173? – Matthew Aug 21 '12 at 06:23
  • 2
    This is a great project: WriteableBitmapEx. It has a "Crop" method, and I've done magical things with it on WP7. http://writeablebitmapex.codeplex.com/ – William Melani Aug 21 '12 at 16:42

1 Answers1

1

I accomplished this by referencing Resize image for Live Tile - WriteableBitmapEx which proved to have the correct implementation.

Community
  • 1
  • 1
Matthew
  • 3,976
  • 15
  • 66
  • 130