From: Chris244@aol.com (Chris Hill) Subject: Re: drawing on the Canvas Date: 28 Apr 1999 00:00:00 GMT Message-ID: <372766f5.3781175512@forums.borland.com> References: <3727087C.9494CD96@imprsv.com> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.delphi.graphics Use ExtCreatePen with PS_ENDCAP_SQUARE. You can also use PS_ENDCAP_FLAT if you don't want the line to extend past the end points. Since you want a square look if you draw a very short line I would guess you want PS_ENDCAP_SQUARE. var lb : TLogBrush; begin Canvas.Pen.Width := 5; with lb do begin lb.lbStyle := BS_SOLID; lb.lbColor := Canvas.Pen.Color; end; Canvas.Pen.Handle := ExtCreatePen(PS_GEOMETRIC Or PS_SOLID Or PS_ENDCAP_SQUARE, Canvas.Pen.Width, lb, 0,nil); Canvas.MoveTo(10,10); Canvas.LineTo(100,100); end; On Wed, 28 Apr 1999 09:09:16 -0400, Sim Zacks wrote: >In my application the user can draw on the canvas freeform, and I >implement this using canvas.lineto. However the pixel always comes up >circular and not rectangular. If you just draw one pixel it is a circle >and if you draw the whole line the beginning and end are rounded. does >anyone know how to draw in a rectangle or square? In MSPaint you have >the option if you want to paint square pixels or round pixels, and I >can't figure out how that is done. >Thanks >Sim > Chris Hill Chris244@aol.com