管理OLE对象
Contents
[
Hide
]对象链接和嵌入(OLE)是一个Microsoft Windows功能,允许您在从一个应用程序复制或移动信息到另一个应用程序的同时保留在原始应用程序中编辑信息的能力。基本上,OLE将来自不同应用程序的数据组合到一个文档中。要使用OLE,您需要支持OLE的源应用程序和目标应用程序。
导出嵌入的OLE对象
Aspose.CAD for .NET 现在支持从DWG格式导出嵌入的OLE对象。本文演示了如何使用Aspose.CAD将嵌入的OLE对象从DWG格式导出为PNG。
下面是实现此功能的示例代码。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The path to the documents directory. | |
string MyDir = RunExamples.GetDataDir_DWGDrawings(); | |
string[] files = new string[] { "D ZD junior D10m H2m.dwg", "ZD - Senior D6m H2m45.dwg" }; | |
PngOptions pngOptions = new PngOptions { }; | |
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions(); | |
pngOptions.VectorRasterizationOptions = rasterizationOptions; | |
rasterizationOptions.Layouts = new string[] { "Layout1" }; | |
foreach (string file in files) | |
{ | |
using (CadImage cadImage = (CadImage)Image.Load(MyDir + file)) | |
{ | |
cadImage.Save(MyDir + file + "_out.png", pngOptions); | |
} | |
} |