采用Aspose.CAD 出图速度非常慢,有什么好的方式加速吗,在分辨率超过16384后,内存崩溃,我才用分幅渲染方式,但是渲染效率非常低,是我的方式有问题吗?
for (int i = 0; i < vportLists.size(); i++)
{
CadVportTableObject currentView = (CadVportTableObject)vportLists.get_Item(i);
CadStringParameter curNamePara= currentView.getName();
String viewName= curNamePara.getValue().toLowerCase();
if((curNamePara==null && vportLists.size()==1)|| viewName.equals("*active"))
{
dparaheight.setValue((bomPixel-topPixel)*resolution);
currentView.setViewHeight(dparaheight);
currentView.setCenterPoint(center);
paraAspectRatio.setValue(realW/realH);
currentView.setViewAspectRatio(paraAspectRatio);
}
cadImage.setViewPorts(vportLists);
String tempDir = outputDir+"/tmp/";
File dir = new File(tempDir);
if(!dir.exists()){
dir.mkdirs();
}
String resultPng=tempDir+imgInde+".png";
cadImage.save(resultPng, pngOptions);
// strPngList+=" " + resultPng +" hspacing " + " " + realW + " vspacing " + realH;
strPngList+=" " + resultPng;
imgInde++;
}
The speed of drawing with aspose.cad is very slow. Is there any good way to speed up? After the resolution exceeds 16384, the memory crashes and I just use the framing rendering method, but the rendering efficiency is very low. Is there any problem with my method?
for (int i = 0; i < vportLists.size(); i++)
{
CadVportTableObject currentView = (CadVportTableObject)vportLists.get_Item(i);
CadStringParameter curNamePara= currentView.getName();
String viewName= curNamePara.getValue().toLowerCase();
if((curNamePara==null && vportLists.size()==1)|| viewName.equals("*active"))
{
dparaheight.setValue((bomPixel-topPixel)*resolution);
currentView.setViewHeight(dparaheight);
currentView.setCenterPoint(center);
paraAspectRatio.setValue(realW/realH);
currentView.setViewAspectRatio(paraAspectRatio);
}
cadImage.setViewPorts(vportLists);
String tempDir = outputDir+"/tmp/";
File dir = new File(tempDir);
if(!dir.exists()){
dir.mkdirs();
}
String resultPng=tempDir+imgInde+".png";
cadImage.save(resultPng, pngOptions);
// strPngList+=" " + resultPng +" hspacing " + " " + realW + " vspacing " + realH;
strPngList+=" " + resultPng;
imgInde++;
}
@HellWorld,
I have observed the issue shared by you and request you to please first try using latest Aspose.CAD for .NET 20.3 on your end. In case there is still an issue then please share the source file, Operating System details, machine details and statistics achieved on your end along with generated output. We will try to investigate the issue further on our end on provision of requested information.
1 Like
Hi mudassir ! Thank you for your reply. I just use the latest version 20.3, which has not improved the speed. When I do local rendering, do I need to provide clipping algorithm outside the plug-in? If not, the rendering speed will be very slow, which is equivalent to the whole image rendering. Where can the forum upload files? If convenient, can you leave a mailbox?
@HellWorld,
You can share the working sample project with us here in this thread if that has size less than 3 MB. Otherwise, you can upload that on Google drive or any other FTP server and share the download link with us along with all requested details.