Курсовая работа: Разработка графического редактора
Описание метода TForm1.DrawShape:
procedure TForm1.DrawShape(TopLeft, BottomRight: TPoint; AMode: TPenMode);
var i:integer;
begin
with image1.Canvas do
begin
Pen.Mode :=amode;
case DrawingTool of
dtHandle: //КАРАНДАШ
begin
Pen.Mode :=pmcopy;
image1.Canvas.Pixels[topleft.x,topleft.y]:=colordialog1.Color;
image1.Canvas.LineTo(BottomRight.X, BottomRight.Y);
end;
dtLine: //РИСОВАНИЕ ЛИНИИ
begin
image1.Canvas.MoveTo(TopLeft.X, TopLeft.Y);
image1.Canvas.LineTo(BottomRight.X, BottomRight.Y);
end;
dtPolyline: //ПИРАМИДА
begin
image1.Canvas.Polyline([origin, movept, point(spinedit1.Value, spinedit2.Value)]);
end;
dtSpray: //РАСПЫЛИТЕЛЬ
begin
Pen.Mode :=pmcopy;
for i:=1 to 20 do
begin
image1.Canvas.Pixels[BottomRight.X+random(20),