Beheren van OLE-objecten

Exporteren van ingesloten OLE-objecten

Aspose.CAD voor .NET ondersteunt nu het exporteren van ingesloten OLE-objecten vanuit DWG-indeling. Dit artikel demonstreert hoe je ingesloten OLE-objecten van DWG-indeling naar PNG kunt exporteren met Aspose.CAD.

De voorbeeldcode hieronder toont hoe je deze functie kunt bereiken.

// 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);
}
}