[英]Sending an Image from WP7 to WCF and converting to Bitmap
我正在嘗試將圖片從Windows Phone發送到WCF服務,該服務需要System.Drawing.Bitmap。 但是,我無法從手機上獲取BitmapImage,也無法在WCF服務上獲取位圖。 我在C#中執行此操作。
我嘗試過將BitmapImage轉換為byte [],通過WCF發送,然后將其轉換回BitmapImage,然后將其轉換為Bitmap。 我可以得到BitmapImage的大小,但是圖像中的數據為空。 關於可能出問題的任何線索?
我該怎么做呢?
問題可能出在maxReceivedMessageSize
。 您說可以獲取BitmapImage的大小,但是正確的大小嗎? 如果沒有,請在WCF的web.config中添加以下行:
<bindings>
<wsHttpBinding>
<binding name="wsHttp"
maxReceivedMessageSize ="50000000"
messageEncoding="Mtom"
maxBufferPoolSize="50000000" >
<readerQuotas maxDepth="32"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="8192"
maxNameTableCharCount="2147483647" />
</binding>
</wsHttpBinding>
</bindings>
現在再試一次,現在應該可以了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.