TLDR: Unable to convert Stream to ObservableCollection<IDrawingLine>
Having a DrawingView:
<code><toolkit:DrawingView
DrawingLineStarted="Signature_DrawingLineStarted"
ShouldClearOnFinish="False"
BackgroundColor="Transparent"
IsMultiLineModeEnabled="True"
Lines="{Binding Signature, Mode=OneWayToSource}"/>
</code>
<code><toolkit:DrawingView
DrawingLineStarted="Signature_DrawingLineStarted"
ShouldClearOnFinish="False"
BackgroundColor="Transparent"
IsMultiLineModeEnabled="True"
Lines="{Binding Signature, Mode=OneWayToSource}"/>
</code>
<toolkit:DrawingView
DrawingLineStarted="Signature_DrawingLineStarted"
ShouldClearOnFinish="False"
BackgroundColor="Transparent"
IsMultiLineModeEnabled="True"
Lines="{Binding Signature, Mode=OneWayToSource}"/>
I’m able to get the related Stream of the drawing like this:
<code>Stream SignatureStream = await (DrawingView.GetImageStream(Signature, new Size(150, 150),
Microsoft.Maui.Graphics.Colors.Transparent, cts.Token));
</code>
<code>Stream SignatureStream = await (DrawingView.GetImageStream(Signature, new Size(150, 150),
Microsoft.Maui.Graphics.Colors.Transparent, cts.Token));
</code>
Stream SignatureStream = await (DrawingView.GetImageStream(Signature, new Size(150, 150),
Microsoft.Maui.Graphics.Colors.Transparent, cts.Token));
Now I can save this drawing as a byte array into an external file. But my question is the following:
How can I load the drawing back again?
I can get the Stream from the file, but I haven’t found a way to put the Stream content back into the DrawingView.