コード例 #1
0
ファイル: Pen.cs プロジェクト: DanCope/Orbits
        /// <summary>
        /// Creates a new <see cref="Pen"/> with the given brush and width.
        /// </summary>
        /// <param name="brush">The <see cref="Brush"/> used to stroke the pen.</param>
        /// <param name="width">The width of the paths drawn by the pen.</param>
        /// <param name="ownsBrush"><c>true</c> if the pen should be responsible for disposing the <see cref="Brush"/>, <c>false</c> otherwise.</param>
        public Pen(Brush brush, float width, bool ownsBrush)
            : this()
        {
            if (brush == null)
            {
                throw new ArgumentNullException("brush");
            }

            _width = width;

            Brush     = brush;
            OwnsBrush = ownsBrush;

            StartCapInfo = CreateLineCapInfo(StartCap, Width);
            EndCapInfo   = CreateLineCapInfo(EndCap, Width);
        }
コード例 #2
0
ファイル: Pen.cs プロジェクト: Luckyknight1/LilyPath
        /// <summary>
        /// Creates a new <see cref="Pen"/> with the given brush and width.
        /// </summary>
        /// <param name="brush">The <see cref="Brush"/> used to stroke the pen.</param>
        /// <param name="width">The width of the paths drawn by the pen.</param>
        /// <param name="ownsBrush"><c>true</c> if the pen should be responsible for disposing the <see cref="Brush"/>, <c>false</c> otherwise.</param>
        public Pen (Brush brush, float width, bool ownsBrush)
            : this()
        {
            if (brush == null)
                throw new ArgumentNullException("brush");

            _width = width;

            Brush = brush;
            OwnsBrush = ownsBrush;

            StartCapInfo = CreateLineCapInfo(StartCap, Width);
            EndCapInfo = CreateLineCapInfo(EndCap, Width);
        }