Question

I am trying to develop a Music Player for Windows Phone 7. In this, i have to load all the album art images of albums in the media library one by one as 200X200px image using:

albumArtStream = library.Albums[loop_counter].GetAlbumArt();

But, the original album art images being of size 500X500px each (approx), the memory usage increases to about 150-200MB, crashing the app. I tried to check for memory leak using the application analysis option, but it didn't help. Temporarily i'm using:

albumArtStream = library.Albums[loop_counter].GetThumbnail();

Here, memory usage is just about 25MB. But, because its thumbnail, the album art images don't look good at all.

Can anyone help me out and tell me some way to reduce image resolution/size to my required size and save on memory?

Was it helpful?

Solution

Found what i was looking for. Optimizing image size can be done by ScaleTransform. Here's where i found the solution: http://www.wintellect.com/CS/blogs/jprosise/archive/2009/12/17/silverlight-s-big-image-problem-and-what-you-can-do-about-it.aspx

Although the blog post is for some website the blogger is creating, he talks about Silverlight's problem in this post, and hence applicable here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top