杆
是否要使用浏览器中使用的图形预览图像?
如果是这样,那么像这样的事情可能会奏效,每种文件类型背后的IDE都是相同的,因此现在每个CAD文件都有一个嵌入式位图,explorer可以查看。
- Public Sub PreviewBitmap_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PreviewBitmap.Click
- DrawBitmapPreview(aFile)
- End Sub
-
- Private Sub DrawBitmapPreview(ByVal file As IEdmFile5)
- Try
-
- Dim varEnum As IEdmEnumeratorVariable5
- varEnum = file.GetEnumeratorVariable
- Dim preview As IEdmBitmap5
- preview = varEnum.GetThumbnail
- If preview Is Nothing Then Exit Sub
- preview.Draw(Me.Handle.ToInt32(), 45, 220, 0, 0)
-
- Catch ex As System.Runtime.InteropServices.COMException
- MessageBox.Show("HRESULT = 0x" + ex.ErrorCode.ToString("X") + " " + ex.Message)
- Catch ex As Exception
- MessageBox.Show(ex.Message)
- End Try
- End Sub
复制自:http://help.solidworks.com/2017/english/api/epdmapi/get_bitmap_preview_of_file_example_vbnet.htm |