Profile Picture

How to replace the standar Computer image?

Posted By andres caceres 15 Years Ago
Author
Message
andres caceres
explanationmark Posted 15 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: Forum Members
Last Active: 15 Years Ago
Posts: 3, Visits: 1

Hi there,

 

I need to change the standard Computer image created by the NSimpleNetworkShapesFactory.

As far as I know there are two methods, one is creating it by code:

  public class diagramTest : NSimpleNetworkShapesFactory
    {

        protected override NShape CreateComputer()
        {
            NCompositeShape shape = new NCompositeShape();

            GraphicsPath graphicsPath = new GraphicsPath();
            PointF[] points = new PointF[]
            {
                new PointF(0, 0),
                new PointF(0, 20),
                new PointF(20, 20),
                new PointF(20, 0),
            };

            graphicsPath.AddPolygon(points);

            shape.Primitives.AddChild(new NCustomPath(graphicsPath, PathType.ClosedFigure));
            shape.UpdateModelBounds();

            shape.Style.FillStyle = new NColorFillStyle(Color.AliceBlue);
            shape.Style.StrokeStyle = new NStrokeStyle(1, Color.FromArgb(0, 0, 0x88));

            return shape;
        }      
    }

 

But that's insane. I also know it's possible to desing my own computer shapes by using the Nevron Diagram for DotNet. I used that editor to make a test shape and I saved it with a .NDB extension.

So, the question is: how do I use that file in my code?

 

My scenario is: an ASPX web app, a NDrawingview in a web form. I'm using it to paint a network diagram.

 

Thank you so much,

 

 

}






Similar Topics


Reading This Topic