Solid Edge Framework Type Library
SaveAsImage Method
The file name of the saved file. The extension you specify determines the format of the saved file. You can specify .bmp (Windows Bitmap), .tif (TIFF), or .jpg (JPEG).
Specifies the width of the file. (Relative to resolution)
Specifies the height of the file. (Relative to resolution)
Alternate view style (Name of 3D view style)

Resolution of image (encoded as DPI - Dots per inch).

Use "1" in order to specify image width and height in pixels.

Final pixel width and height are equal to width*resolution and height*resolution respectively.

Bits per pixel color depth.

Valid value for JPG is 24.

Valid value for BMP are 8, 24.

Valid values for TIF are 1, 8, 24

For binary files, specifies whether the file's black and white values are inverted.
For binary files, specifies whether the file's black and white values are inverted.
Description
Saves the current view as an image.
Syntax
Visual Basic
Public Sub SaveAsImage( _
   ByVal Filename As String, _
   Optional ByVal Width As Variant, _
   Optional ByVal Height As Variant, _
   Optional ByVal AltViewStyle As Variant, _
   Optional ByVal Resolution As Variant, _
   Optional ByVal ColorDepth As Variant, _
   Optional ByVal ImageQuality As SeImageQualityType = 0, _
   Optional ByVal Invert As Boolean = False _
) 
Parameters
Filename
The file name of the saved file. The extension you specify determines the format of the saved file. You can specify .bmp (Windows Bitmap), .tif (TIFF), or .jpg (JPEG).
Width
Specifies the width of the file. (Relative to resolution)
Height
Specifies the height of the file. (Relative to resolution)
AltViewStyle
Alternate view style (Name of 3D view style)
Resolution

Resolution of image (encoded as DPI - Dots per inch).

Use "1" in order to specify image width and height in pixels.

Final pixel width and height are equal to width*resolution and height*resolution respectively.

ColorDepth

Bits per pixel color depth.

Valid value for JPG is 24.

Valid value for BMP are 8, 24.

Valid values for TIF are 1, 8, 24

ImageQuality
ValueDescription
seImageQualityHighMedium quality JPG/TIFF Image
seImageQualityLowLow quality JPG/TIFF Image
seImageQualityMediumMedium quality JPG/TIFF Image
For binary files, specifies whether the file's black and white values are inverted.
Invert
For binary files, specifies whether the file's black and white values are inverted.
Example
Imports System.IO
Imports System.Runtime.InteropServices

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim objAssemblyDocument As SolidEdgeAssembly.AssemblyDocument = Nothing
        Dim SEInstallDir As DirectoryInfo
        Dim objView As SolidEdgeFramework.View = Nothing
        Dim objCurWindow As SolidEdgeFramework.Window

        Try
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")
            SEInstallDir = GetTrainingFolder()
            objAssemblyDocument = objApplication.Documents.Open(SEInstallDir.FullName + "\carrier.asm")
            objCurWindow = objApplication.ActiveWindow
            objView = objCurWindow.View
            objView.SaveAsImage("C:\Carrier.jpg", 1920, 1080, "Default", 1, 24, SolidEdgeFramework.SeImageQualityType.seImageQualityHigh, False)

        Catch ex As Exception
            MsgBox(ex.ToString)
            Clipboard.SetText(ex.ToString)
        End Try
    End Sub
    
    Function GetTrainingFolder() As DirectoryInfo
        Dim objInstallData As SEInstallDataLib.SEInstallData = Nothing
        Dim objInstallFolder As DirectoryInfo = Nothing
        Dim objTrainingFolder As DirectoryInfo = Nothing

        Try
            objInstallData = New SEInstallDataLib.SEInstallData
            objInstallFolder = New DirectoryInfo(objInstallData.GetInstalledPath())
            objTrainingFolder = New DirectoryInfo(Path.Combine(objInstallFolder.Parent.FullName, "Training"))
        Catch
        Finally
            If Not (objInstallData Is Nothing) Then
                Marshal.FinalReleaseComObject(objInstallData)
                objInstallData = Nothing
            End If
        End Try

        Return objTrainingFolder
    End Function

End Class
See Also

View Object  | View Members