Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Line, square, rectangle drawing
Wed, Dec 16 2015 3:20 AMPermanent Link

Trinione

Maybe I am just not seeing it. But, how can I draw a horizontal line? Or a square? A circle?
Wed, Dec 16 2015 4:13 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi,

If you use a TPaint component you can use things like LineTo(X,Y) etc.

There is an Paint example project that ships with EWB2 that demonstrates
this.

Chris Holland
[Team Elevate]

On 16/12/2015 08:20, Trinione wrote:
> Maybe I am just not seeing it. But, how can I draw a horizontal line? Or a square? A circle?
>
Wed, Dec 16 2015 4:17 AMPermanent Link

Matthew Jones

Trinione wrote:

> Maybe I am just not seeing it. But, how can I draw a horizontal line?
> Or a square? A circle?

Here's something to get you started. Drop a TPaint on the form, and the
rest should give you the right clues. Basically you draw on its canvas.



     Paint1: TPaint;

       m_xBlah.DrawToCanvas(paint1.Canvas, lblTest.Font);


procedure TBlah.DrawToCanvas(xCanvas : TCanvasElement; xFont : TFont);
begin                                            
   xCanvas.FillColor := clWhite;
   xCanvas.FillRect(0, 0, xCanvas.Width, xCanvas.Height);


   xCanvas.MoveTo(ptStart.X, ptStart.Y);
   xCanvas.LineTo(ptEnd.X, ptEnd.Y);
   xCanvas.Stroke;

end;

--

Matthew Jones
Wed, Dec 16 2015 5:10 PMPermanent Link

Trinione

Thank you both.
Image