Пример #1
0
        public override void Paint(Graphics graphics)
        {
            Point pointN  = SupplierElement.GetOutputLineConnectionPoint(Item);
            Point pointM  = ConsumerElement.GetInputLineConnectionPoint(Item);
            Point pointN2 = new Point(pointN.X, pointN.Y - Math.Max((int)((pointN.Y - pointM.Y) / 2), 40));
            Point pointM2 = new Point(pointM.X, pointM.Y + Math.Max((int)((pointN.Y - pointM.Y) / 2), 40));

            using (Pen pen = new Pen(DataCache.IconAverageColour(Item.Icon), 3f))
            {
                graphics.DrawBezier(pen, pointN, pointN2, pointM2, pointM);
            }
        }
Пример #2
0
        public override void Paint(System.Drawing.Graphics graphics)
        {
            Point pointN = Parent.ScreenToGraph(Parent.PointToClient(Cursor.Position));
            Point pointM = pointN;

            if (SupplierElement != null)
            {
                pointN = SupplierElement.GetOutputLineConnectionPoint(Item);
            }
            if (ConsumerElement != null)
            {
                pointM = ConsumerElement.GetInputLineConnectionPoint(Item);
            }
            Point pointN2 = new Point(pointN.X, pointN.Y - Math.Max((int)((pointN.Y - pointM.Y) / 2), 40));
            Point pointM2 = new Point(pointM.X, pointM.Y + Math.Max((int)((pointN.Y - pointM.Y) / 2), 40));

            using (Pen pen = new Pen(DataCache.IconAverageColour(Item.Icon), 3f))
            {
                graphics.DrawBezier(pen, pointN, pointN2, pointM2, pointM);
            }
        }