Solid Edge Framework Type Library > View Object : SaveAsImage Method |
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
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 _ ) |
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
Value | Description |
---|---|
seImageQualityHigh | Medium quality JPG/TIFF Image |
seImageQualityLow | Low quality JPG/TIFF Image |
seImageQualityMedium | Medium quality JPG/TIFF Image |
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