Source/Presentation/ShapePath.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;

namespace DevComponents.DotNetBar.Presentation
{
    internal class ShapePath : Shape
    {
        #region Private Variables
        private ShapeBorder m_Border = null;
        private ShapeFill m_Fill = null;
        private GraphicsPath m_Path = null;
        #endregion

        #region Internal Implementation
        public ShapePath() { }
        public ShapePath(ShapeBorder border)
        {
            m_Border = border;
        }
        public ShapePath(ShapeFill fill)
        {
            m_Fill = fill;
        }
        public ShapePath(ShapeBorder border, ShapeFill fill)
        {
            m_Border = border;
            m_Fill = fill;
        }

        public GraphicsPath Path
        {
            get { return m_Path; }
            set { m_Path = value; }
        }

        public override void Paint(ShapePaintInfo p)
        {
            if(m_Path == null)
                return;
            
            System.Drawing.Rectangle bounds = this.GetBounds(p.Bounds);
            Graphics g = p.Graphics;

            if (m_Fill != null)
                PaintFill(g, bounds);

            if (m_Border != null)
                PaintBorder(g, bounds);

            base.Paint(p);
        }

        /// <summary>
        /// Paints the border.
        /// </summary>
        protected virtual void PaintBorder(Graphics g, System.Drawing.Rectangle r)
        {
            if (m_Border.Color1.IsEmpty)
后面还有 73 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。