CustomLineCap

CustomLineCap marshal by reference, disposable

System.Drawing.Drawing2D (system.drawing.dll) class

This class is used to create your own custom imagery for a linecap. It is also a base class for the AdjustableArrowCap .

You can specify the BaseCap on which the custom cap is based. You should pick the cap most similar to the one you are about to draw. The BaseInset allows you to move the relative position of the end of the line and the endcap. The StrokeJoin is used to specify the join-style of the line segments in the cap, and the WidthScale is used to specify how the cap should be scaled as the line width changes.

The actual shape of the cap is specified at construction time, by specifying two GraphicsPath objects: one to make the outline (the stroke path) and the other to make the fill (the fill path ).

Note that a defect in the current version of the GDI+ rendering engine means that the framework does not correctly calculate the bounds of a path using a custom endcap, if that endcap has radically different proportions to its BaseCap .

 public class  CustomLineCap  : MarshalByRefObject : ICloneable, IDisposable {  // Public Constructors  public  CustomLineCap  (GraphicsPath  fillPath  , GraphicsPath  strokePath  );    public  CustomLineCap  (GraphicsPath  fillPath  , GraphicsPath  strokePath  , LineCap  baseCap  );    public  CustomLineCap  (GraphicsPath  fillPath  , GraphicsPath  strokePath  , LineCap  baseCap  , float  baseInset  );  // Public Instance Properties  public LineCap  BaseCap  {set; get; }    public float  BaseInset  {set; get; }    public LineJoin  StrokeJoin  {set; get; }    public float  WidthScale  {set; get; }  // Public Instance Methods  public object  Clone  ();  // implements ICloneable  public void  Dispose  ();  // implements IDisposable  public void  GetStrokeCaps  (out LineCap  startCap  , out LineCap  endCap  );    public void  SetStrokeCaps  (LineCap  startCap  , LineCap  endCap  );  // Protected Instance Methods  protected virtual void  Dispose  (bool  disposing  );    protected override void  Finalize  ();  // overrides object  } 

Hierarchy

System.Object System.MarshalByRefObject CustomLineCap(System.ICloneabl, System.IDisposable)

Subclasses

AdjustableArrowCap

Returned By

System.Drawing.Pen.{CustomEndCap , CustomStartCap}

Passed To

System.Drawing.Pen.{CustomEndCap , CustomStartCap}



. Net Windows Forms in a Nutshell
.NET Windows Forms in a Nutshell
ISBN: 0596003382
EAN: 2147483647
Year: 2002
Pages: 794

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net