how to load high resolution image windows phone taskagent? [out of memory]

后端 未结 2 851
不知归路
不知归路 2021-01-07 01:06

As we know, it is only 11.5MB memory that can be used in a Windows Phone 8 task agent. I was trying to make dynamic lock screen image in the background task agent. When I ge

相关标签:
2条回答
  • 2021-01-07 01:25

    just try some many times i has been fix this problem. as you see it was only have 11M memory can be use in windows phone taskagent. i was tring to make dynamic lock screen background. my soluction is download image from sever side and save to local display it.

    why got out of memory Exception?

    download image Byte[]=>Write to memory=>build writeableBitmap with 768*1280.

    same image memory just cast three time .

    so how to fix it ?

    when you download your image from server side. you should be save to local isolate storage immediately and clear memory useage about the image byte[]. just set the image url to lockscreen . got be work.

    download image Byte[]=>Save To local =>clear image byte memory.

    everything is fine.

    0 讨论(0)
  • 2021-01-07 01:28

    I'm guessing the memory adds up.

    Try saving it to a file, free the variable/resource, than load it from the file using the constructor parameter.

    0 讨论(0)
提交回复
热议问题