This documentation is archived and is not being maintained.

WorkflowView.SaveWorkflowImage Method (Stream, ImageFormat)

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 void SaveWorkflowImage(
	Stream stream,
	ImageFormat 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.


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 void SaveWorkflowImageUsingStream()
    SaveFileDialog saveFileDialog = new SaveFileDialog();
    saveFileDialog.Filter = "Bitmap Files|*.bmp";
    if (saveFileDialog.ShowDialog() == DialogResult.OK)
        using (FileStream fileStream = new FileStream(saveFileDialog.FileName, FileMode.Create))
            this.workflowView.SaveWorkflowImage(fileStream, ImageFormat.Bmp);

.NET Framework

Supported in: 4, 3.5, 3.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.