4
私は署名パネルに使用しているMVVMモデルのStrokeCollectionにバインドされたInkPresenterを持っています。私は戻って、私はPNGデータにStrokeCollectionを変換するサーバにデータを送信する前に、ここで私は(私はImageToolsライブラリを使用しています)持っているものです。WP7 MVVMを使用してStrokeCollectionをPNGに変換しますか?
// Signature is a StrokesCollection
var bounds = Signature.GetBounds();
var inkSignature = new InkPresenter {Height = bounds.Height, Width = bounds.Width, Strokes = Signature};
var wbBitmap = new WriteableBitmap(inkSignature, null);
var myImage = wbBitmap.ToImage();
byte[] by = null;
MemoryStream stream = null;
using (stream = new MemoryStream())
{
PngEncoder png = new PngEncoder();
png.Encode(myImage, stream);
}
ストリームは常にちょうど0で満たされています、私は思っていない本当にシンプルなものを見逃しているような気がする。何か案は?