public virtual bool RenderImage(string saveToBmp, bool bRotate90 = false) { ImageGraphic graphic = null; try { int frame = 0; if (frame != CurrentFrame || _pixelData == null) { Load(Dataset, frame); } graphic = new ImageGraphic(_pixelData); if (ShowOverlays) { foreach (var overlay in _overlays) { if ((frame + 1) < overlay.OriginFrame || (frame + 1) > (overlay.OriginFrame + overlay.NumberOfFrames - 1)) { continue; } var og = new OverlayGraphic( PixelDataFactory.Create(overlay), overlay.OriginX - 1, overlay.OriginY - 1, OverlayColor); graphic.AddOverlay(og); og.Scale(this._scale); } } //return graphic.RenderImage(this._pipeline.LUT, bRotate90, saveToBmp); return(graphic.RenderFileImage(this._pipeline.LUT, saveToBmp)); } finally { if (graphic != null) { graphic = null; } } //RenderFileImage直接将像素数据输出到文件,无需内存中转以节约内存占用 }