Edit

Share via


WorkflowView.SaveWorkflowImage Method

Definition

Saves an image of the WorkflowView based on the specified image format.

Overloads

SaveWorkflowImage(Stream, ImageFormat)

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

SaveWorkflowImage(String, ImageFormat)

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

SaveWorkflowImage(Stream, ImageFormat)

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

public:
 void SaveWorkflowImage(System::IO::Stream ^ stream, System::Drawing::Imaging::ImageFormat ^ imageFormat);
public void SaveWorkflowImage (System.IO.Stream stream, System.Drawing.Imaging.ImageFormat imageFormat);
member this.SaveWorkflowImage : System.IO.Stream * System.Drawing.Imaging.ImageFormat -> unit
Public Sub SaveWorkflowImage (stream As Stream, imageFormat As ImageFormat)

Parameters

stream
Stream

The Stream to save the workflow view image to.

imageFormat
ImageFormat

The ImageFormat to use to save the workflow view image.

Exceptions

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

Examples

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

Remarks

The workflow view image is created as a bitmap.

Applies to

SaveWorkflowImage(String, ImageFormat)

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

public:
 void SaveWorkflowImage(System::String ^ imageFile, System::Drawing::Imaging::ImageFormat ^ imageFormat);
public void SaveWorkflowImage (string imageFile, System.Drawing.Imaging.ImageFormat imageFormat);
member this.SaveWorkflowImage : string * System.Drawing.Imaging.ImageFormat -> unit
Public Sub SaveWorkflowImage (imageFile As String, imageFormat As ImageFormat)

Parameters

imageFile
String

The path to the file in which to store the workflow view image.

imageFormat
ImageFormat

The ImageFormat to use to save the workflow view image.

Exceptions

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

Examples

The following example shows how to save the currently loaded workflow image using a String. In this example, a SaveFileDialog is created to prompt the user for the filename of the image to save. The filename and the ImageFormat.Bmp flag are then passed to the SaveWorkflowImage method.

public void SaveWorkflowImage()
{
    SaveFileDialog saveFileDialog = new SaveFileDialog();
    saveFileDialog.Filter = "Bitmap Files|*.bmp";
    if (saveFileDialog.ShowDialog() == DialogResult.OK)
    {
        this.workflowView.SaveWorkflowImage(saveFileDialog.FileName, ImageFormat.Bmp);
    }
}
Public Sub SaveWorkflowImage()
    Dim SaveFileDialog As New SaveFileDialog()
    SaveFileDialog.Filter = "Bitmap Files|*.bmp"
    If SaveFileDialog.ShowDialog() = DialogResult.OK Then
        Me.workflowView.SaveWorkflowImage(SaveFileDialog.FileName, ImageFormat.Bmp)
    End If
End Sub

Remarks

The workflow view image is created as a bitmap.

Applies to