StrokeCollection.Save Metodo

Definizione

Salva l'oggetto StrokeCollection.

Overload

Nome Descrizione
Save(Stream)

Salva l'oggetto StrokeCollection nell'oggetto specificato Stream.

Save(Stream, Boolean)

Salva l'oggetto StrokeCollection nell'oggetto specificato Stream e lo comprime, se specificato.

Save(Stream)

Salva l'oggetto StrokeCollection nell'oggetto specificato Stream.

public:
 void Save(System::IO::Stream ^ stream);
public void Save(System.IO.Stream stream);
member this.Save : System.IO.Stream -> unit
Public Sub Save (stream As Stream)

Parametri

stream
Stream

Oggetto Stream in cui salvare l'oggetto StrokeCollection.

Esempio

Nell'esempio seguente viene illustrato come salvare un oggetto StrokeCollection in un file usando il Save(Stream, Boolean) metodo . In questo esempio si presuppone che sia presente un InkCanvas oggetto denominato inkCanvas1.

private void SaveStrokes_Click(object sender, RoutedEventArgs e)
{
    FileStream fs = null;

    try
    {
        fs = new FileStream(inkFileName, FileMode.Create);
        inkCanvas1.Strokes.Save(fs);
    }
    finally
    {
        if (fs != null)
        {
            fs.Close();
        }
    }
}
Private Sub SaveStrokes_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)

    Dim fs As FileStream = Nothing

    Try
        fs = New FileStream(inkFileName, FileMode.Create)
        inkCanvas1.Strokes.Save(fs)
    Finally
        If Not fs Is Nothing Then
            fs.Close()
        End If
    End Try

End Sub

Commenti

Il Save metodo salva come StrokeCollection Ink Serialized Format (ISF).

Si applica a

Save(Stream, Boolean)

Salva l'oggetto StrokeCollection nell'oggetto specificato Stream e lo comprime, se specificato.

public:
 virtual void Save(System::IO::Stream ^ stream, bool compress);
public virtual void Save(System.IO.Stream stream, bool compress);
abstract member Save : System.IO.Stream * bool -> unit
override this.Save : System.IO.Stream * bool -> unit
Public Overridable Sub Save (stream As Stream, compress As Boolean)

Parametri

stream
Stream

Oggetto Stream in cui salvare l'oggetto StrokeCollection.

compress
Boolean

true per comprimere ; StrokeCollectionin caso contrario, false.

Esempio

Nell'esempio seguente viene illustrato come salvare un oggetto StrokeCollection in un file usando il Save(Stream, Boolean) metodo . In questo esempio si presuppone che sia presente un InkCanvas oggetto denominato inkCanvas1.

private void SaveStrokes_Click(object sender, RoutedEventArgs e)
{
    FileStream fs = null;

    try
    {
        fs = new FileStream(inkFileName, FileMode.Create);
        inkCanvas1.Strokes.Save(fs);
    }
    finally
    {
        if (fs != null)
        {
            fs.Close();
        }
    }
}
Private Sub SaveStrokes_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)

    Dim fs As FileStream = Nothing

    Try
        fs = New FileStream(inkFileName, FileMode.Create)
        inkCanvas1.Strokes.Save(fs)
    Finally
        If Not fs Is Nothing Then
            fs.Close()
        End If
    End Try

End Sub

Commenti

Il Save metodo salva come StrokeCollection Ink Serialized Format (ISF).

Si applica a