Hello, I am adding a 15mb image to the background of a RadDiagramShape. The problem I am running into is the RadDiagram eats up 1gb of memory every time I open the form. Eventually if I don't call GC.Collect the Image.FromStream blows up due to a memory limit. I have traced it back to the RadDiagram utilizing a ton of memory. The question I have is what performance considerations should I be looking at with the control? I included the steps I am taking to add in the image.
Thanks in advance!
Brian
uiMap.DiagramElement.IsBackgroundSurfaceVisible = false;
uiMap.SelectionMode = Telerik.Windows.Diagrams.Core.SelectionMode.None;
RadDiagramShape backgroundImage = new RadDiagramShape()
{
Name = "Image"
};
backgroundImage.IsConnectorsManipulationEnabled = false;
backgroundImage.IsRotationEnabled = false;
backgroundImage.IsResizingEnabled = false;
backgroundImage.IsDraggingEnabled = false;
backgroundImage.CaptureOnMouseDown = false;
backgroundImage.IsEnabled = false;
backgroundImage.IsFocusable = false;
backgroundImage.IsHitTestVisible = false;
backgroundImage.ShouldHandleMouseInput = false;
backgroundImage.Shape = new Telerik.WinControls.RoundRectShape(0);
backgroundImage.DiagramShapeElement.Image = floorplan;
backgroundImage.Width = floorplan.Width;
backgroundImage.Height = floorplan.Height;
backgroundImage.ShouldHandleMouseInput = false;
backgroundImage.NotifyParentOnMouseInput = false;
backgroundImage.CaptureOnMouseDown = false;
uiMap.AddShape(backgroundImage);
Telerik.Windows.Diagrams.Core.ToolService toolService = uiMap.ServiceLocator.GetService<Telerik.Windows.Diagrams.Core.IToolService>() as Telerik.Windows.Diagrams.Core.ToolService;
if (toolService != null)
toolService.ToolList[0] = new CustomPanningTool();
uiMap.ActiveTool = Telerik.Windows.Diagrams.Core.MouseTool.PanTool;