Hello everybody,
i am quite a beginner with Lazarus. I want to understand the class concept and how to create a class. But somehow it doesn´t click. I can´t seem to find an example that shows what what is doing. So I am trying to create a Circles Class that draws circles.
As i know this can be done via Canvas.Ellipse.
In my current understanding i could create a Class DrawEllipse, that draws and deletes an Ellipse on the Canvas.
I would need a constructor, a draw method (procedure?) and a delete method (procedure?).
But I just can´t get my head around the draw procedure for example, from my understanding the procedure DrawEllipse.Draw() would be called on my normal form.
But how is the method implemented in the class?
procedure Draw(x1,y1,x2,y2:integer);
var
x1:integer =0;
y1:integer =0;
x2:integer =30;
y2: integer =30;
begin
Canvas.Ellipse(x1,y1,x2,y2);
end;
was my first idea, but it doesn´t work as Canvas is not known.
Thanks in advance,
Skorn