From: "Joe C. Hecht" Subject: Re: ExtCreatePen Date: 27 Mar 1999 00:00:00 GMT Message-ID: <36FC92B1.535E@gte.net> Content-Transfer-Encoding: 7bit References: <36F9532A.8F4@computer-strategies.com> Content-Type: text/plain; charset=us-ascii Organization: Offshore Technology Mime-Version: 1.0 Reply-To: joehecht@gte.net Newsgroups: borland.public.delphi.graphics Eric Schwarz wrote: > > I need to make use of the extended pen features such as square ends. Is > this capability available in D4? Can believe this message has gone unanswered for so long! A) You will need to call the Windows API function ExtCreatePen() to create a geometric pen style, and use the Canvas.Handle property to use the Windows Path functions. Example: procedure TForm1.Button1Click(Sender: TObject); var lb : TLogBrush; begin lb.lbStyle := BS_SOLID; lb.lbColor := RGB(255, 0, 0); lb.lbHatch := 0; Form1.Canvas.Pen.Handle := ExtCreatePen(PS_GEOMETRIC or PS_INSIDEFRAME or PS_ENDCAP_SQUARE or PS_JOIN_BEVEL, 0, lb, 0, nil); BeginPath(Form1.Canvas.Handle); Form1.Canvas.MoveTo(100, 30); Form1.Canvas.LineTo(200, 100); Form1.Canvas.LineTo(300, 30); EndPath(Form1.Canvas.Handle); StrokePath(Form1.Canvas.Handle); Form1.Canvas.Pen.Width := 1; end; Joe -- Joe C. Hecht http://home1.gte.net/joehecht/index.htm