Unplanned
Last Updated: 13 Apr 2021 07:02 by ADMIN
Lou
Created on: 12 Apr 2021 13:13
Category: UI for WinForms
Type: Feature Request
1
RadDiagram: Add support for a background image
Please add support for adding a background image to the RadDiagram. This could be used for example for a floor plan application, where the background image would be a map of a building.
1 comment
ADMIN
Hristo
Posted on: 13 Apr 2021 07:02

Hello Lou,

Thanks for submitting this feature request. We'll consider implementing it in some of our future releases. 

For the time being, a possible workaround is to add a special shape with an image and  use it as background. In order to allow panning, it's necessary to use a custom panning tool: 

public class CustomPanningTool : Telerik.Windows.Diagrams.Core.PanningTool
{
    public override bool MouseMove(Telerik.Windows.Diagrams.Core.PointerArgs e)
    {
        if (this.IsActive)
        {
 
            if (this.HitItem != null && this.HitItem.Name == "BackgroundImage")
            {
                this.HitItem = null;
            }
        }
 
        return base.MouseMove(e);
    }
}

public Form1()
{
    InitializeComponent();
     
    Telerik.Windows.Diagrams.Core.ToolService toolService = this.radDiagram1.ServiceLocator.GetService<Telerik.Windows.Diagrams.Core.IToolService>() as Telerik.Windows.Diagrams.Core.ToolService;
    if (toolService != null)
    {
        toolService.ToolList[0] = new CustomPanningTool();
    }
}

 

Regards,
Hristo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.