[英]WP8 App crashes while trying to create instance of Writablebitmap in c# -Insufficient memory
我想在Windows Phone應用中將圖像轉換為字節數組和字節轉換為圖像。 現在,我試圖將圖像轉換為字節轉換
首先,我創建一個參數為uielement的writablebitmap類實例(即)
WriteableBitmap btmMap = new WriteableBitmap(Imagecontrol,null);
在此行中,由於
內存不足,無法繼續執行程序
我如何在wp8中解決此問題?
您不需要使用帶有UIElement
參數的WriteableBitmap
構造函數,因為Image
控件中已經具有WriteableBitmap
。
只需將Image控件的Source
屬性轉換為WriteableBitmap即可:
WriteableBitmap wb = Imagecontrol.Source as WriteableBitmap;
也許這樣可以避免內存不足異常。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.