Пример #1
0
 /// <summary>
 /// Vykreslí danou rovinnou plochu ohraničenou danou sadou bodů. Provede konverzi souřadného systému
 /// </summary>
 /// <param name="color"></param>
 /// <param name="points"></param>
 private void _FillArea(Color color, IEnumerable <Point3D> points)
 {
     using (GraphicsPath gPath = new GraphicsPath(FillMode.Winding))
     {
         PointF?last = null;
         foreach (Point3D point in points)
         {
             PointF curr = GetPoint2D(point);
             if (last.HasValue)
             {
                 gPath.AddLine(last.Value, curr);
             }
             last = curr;
         }
         gPath.CloseFigure();
         this.Graphics.FillPath(Skin.Brush(color), gPath);
     }
 }
Пример #2
0
        /// <summary>
        /// Kreslení prvku v rámci daných souřadnic
        /// </summary>
        /// <param name="e"></param>
        /// <param name="beginBounds"></param>
        /// <param name="centerBounds"></param>
        /// <param name="endBounds"></param>
        protected void DrawResizer(GInteractiveDrawArgs e, Rectangle beginBounds, Rectangle centerBounds, Rectangle endBounds)
        {
            Color baseColor  = this.GetCurrentValue(this._ResizeControl.InactiveColor, this._ResizeControl.MouseOnParentColor, this._ResizeControl.MouseOverColor, this._ResizeControl.MouseDownColor);
            Color lightColor = Skin.Modifiers.GetColor3DBorderLight(baseColor);
            Color darkColor  = Skin.Modifiers.GetColor3DBorderDark(baseColor);

            if (centerBounds.Height > 0)
            {
                e.Graphics.FillRectangle(Skin.Brush(baseColor), centerBounds);
            }
            if (this.IsMouseDown)
            {   // MouseDown => Begin prostor bude tmavší, End prostor bude světlejší:
                e.Graphics.FillRectangle(Skin.Brush(darkColor), beginBounds);
                e.Graphics.FillRectangle(Skin.Brush(lightColor), endBounds);
            }
            else
            {   // Bez MouseDown:
                e.Graphics.FillRectangle(Skin.Brush(lightColor), beginBounds);
                e.Graphics.FillRectangle(Skin.Brush(darkColor), endBounds);
            }
        }