WorkflowView.SaveWorkflowImage Method (Stream, ImageFormat)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Saves an image of the WorkflowView to the specified stream using the specified image format.

Namespace:   System.Workflow.ComponentModel.Design
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)

Public Sub SaveWorkflowImage (
	stream As Stream,
	imageFormat As ImageFormat


Type: System.IO.Stream

The Stream to save the workflow view image to.

Type: System.Drawing.Imaging.ImageFormat

The ImageFormat to use to save the workflow view image.

Exception Condition

stream or imageFormat contains a null reference (Nothing in Visual Basic).

The workflow view image is created as a bitmap.

The following example shows how to save the currently loaded workflow image using a Stream. In this example, a SaveFileDialog is created to prompt the user for the filename of the image to save. A FileStream object is then created using the filename and then passed to the SaveWorkflowImage method.

Public Sub SaveWorkflowImageImportsStream()

    Dim SaveFileDialog As New SaveFileDialog()
    SaveFileDialog.Filter = "Bitmap Files|*.bmp"
    If SaveFileDialog.ShowDialog() = DialogResult.OK Then
        Using fileStream As New FileStream(SaveFileDialog.FileName, FileMode.Create)
            Me.workflowView.SaveWorkflowImage(fileStream, ImageFormat.Bmp)
        End Using
    End If
End Sub

.NET Framework
Available since 3.0
Return to top