WriteableBitmap Memory Leak?

前端 未结 5 1134
花落未央
花落未央 2020-12-30 01:48

i am using the code below to create a live tile, based on an UI element. It renders the uiElement on a WriteableBitmap, saves the bitmap + returns

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-30 01:53

    i get same exception when convert uielement to writeablebitmap in taskagent. just tried so many times.i found a soluction get be worked.

    wbmp.SaveJpeg(stream, width, heigth, 0, 60);
    

    you can change the quality to 60 when you save uielement to stream. it well reduce memory useage. you can try it.

提交回复
热议问题