在我的web應用程序中,我使用LeadTools從流中創建多頁Tiff文件。以下是顯示我如何使用leadtools的代碼。LeadTools MaximumGlobalRasterImageMemory
using (RasterCodecs codecs = new RasterCodecs())
{
RasterImage ImageToAppened = default(RasterImage);
RasterImage imageSrc = default(RasterImage);
codecs.Options.Load.AllPages = true;
ImageToAppened = codecs.Load(fullInputPath, 1);
FileInfo fileInfooutputTiff = new FileInfo(fullOutputPath);
if (fileInfooutputTiff.Exists)
{
imageSrc = codecs.Load(fullOutputPath);
imageSrc.AddPage(ImageToAppened);
codecs.Save(imageSrc, fullOutputPath, RasterImageFormat.Ccitt, 1);
}
else
{
codecs.Save(ImageToAppened, fullOutputPath, RasterImageFormat.Ccitt, 1);
}
}
上面的代碼工作正常,我在2000年左右的請求中得到了很多對我的web應用程序的請求。在某些情況下,我得到以下錯誤。但後來再次適用於其他請求。
You have exceeded the amount of memory allowed for RasterImage allocations.See RasterDefaults::MemoryThreshold::MaximumGlobalRasterImageMemory.
是內存問題是單個請求還是所有的對象在應用程序啓動期間(全局對象)? 那麼上述錯誤的解決方案是什麼?
您是否嘗試閱讀[文檔](https://www.leadtools.com/help/leadtools/v19m/dh/l/rastermemorythreshold-maximumglobalrasterimagememory.html)? – Evk