C#在调用Aspose.Cells.dll把Excel表格生成图片时内存占用率会越来越高是什么问题?
Workbook book = new Workbook(Application.StartupPath + @"\Config\excel.xlsx");
Worksheet sheet = book.Worksheets[0];
sheet.PageSetup.LeftMargin = 0;
sheet.PageSetup.RightMargin = 0;
sheet.PageSetup.BottomMargin = 0;
sheet.PageSetup.TopMargin = 0;
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Bmp;
imgOptions.OnePagePerSheet = true;
imgOptions.PrintingPage = PrintingPageType.IgnoreBlank;
SheetRender sr = new SheetRender(sheet, imgOptions);
sr.ToImage(0, Application.StartupPath + @"\Config\Excel.bmp");
这段代码是放在timer里面定时循环执行的!