Skip to content

Render graph to image and resize bondingbox #386

Description

@Undertaker911

Hi!
I'm trying to make image of the calculated graph and that works well.

If I manually move the Nodes to get more space in the normal GraphView the bondingbox get bigger and that works well.

But in Render mode is this not possible..., see code example below.

        // Create a new renderer and set its layout algorithm
        var renderer = new Microsoft.Msagl.GraphViewerGdi.GraphRenderer(temp_graph);

        renderer.CalculateLayout();

        UpdateNodePositions(ref temp_graph, PLC_Objects); // move nodes to absolute new center position

        // this is missing !!!
        renderer.Graph.GeometryGraph.UpdateBoundingBox();
       // this is missing !!!

         // Faulty Result.
        // the produced image seize is = the calculated bondingbox,
        // the nodes moved outside the calculated bondingbox is missing.

        // original
        //gViewer1.Graph.GeometryGraph.UpdateBoundingBox();

best regards

Undertaker911

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions