문제

I've created a drawing app in Silverlight that generates a png file from an InkPresenter control when the user hits a "Save" button. I used code from the following article to accomplish the png creation:

http://rongchaua.net/blog/windows-phone-signature-capturing-with-inkpresenter-and-save-to-png-file/

It all works great. However, the last step in the process is to save that png file into a varbinary(max) field in a database table. Does anyone know how to convert the saved png file into a format that is compatible with the varbinary(max) field?

도움이 되었습니까?

해결책

I found a solution. First, I had to increase the max buffer size in my OData Service:

http://malvinly.com/2011/05/09/wcf-data-services-and-maxreceivedmessagesize/

Then, I found this code to convert a bitmap to a byte array:

Silverlight: image to byte[]

Had to do a few other things to tighten it up, but it's now working.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top