Export (0) Print
Expand All

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);

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

.NET Framework

Supported in: 3.5, 3.0

Community Additions

© 2015 Microsoft