Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top