/// <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); }
/// <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); }