Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Public Class class1
<CommandMethod("CreateImage")> _
Public Shared Sub CreateImage()
'zoom extents... need to use .NET 4.0
Dim acad = Application.AcadApplication
acad.ZoomExtents()
Dim doc As Document = Application.DocumentManager.MdiActiveDocument
Using image As Drawing.Bitmap = doc.CapturePreviewImage(3760, 2920)
'save the image...
image.Save("c:\test.png", System.Drawing.Imaging.ImageFormat.Png)
End Using
End Sub
End Class
Imports Autodesk.AutoCAD.ApplicationServices
Public Class class1
<CommandMethod("CreateImage")> _
Public Shared Sub CreateImage()
'zoom extents... need to use .NET 4.0
Dim acad = Application.AcadApplication
acad.ZoomExtents()
Dim doc As Document = Application.DocumentManager.MdiActiveDocument
Using image As Drawing.Bitmap = doc.CapturePreviewImage(3760, 2920)
'save the image...
image.Save("c:\test.png", System.Drawing.Imaging.ImageFormat.Png)
End Using
End Sub
End Class
【API 捕捉预览图像.rar】点击下载此文件
https://www.keanw.com/2016/02/capturing-an-image-o ... d-document-using-net.html
[本日志由 tiancao1001 于 2019-09-09 08:25 PM 编辑]
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |