Begin
img1.picture.Assign(img2.picture);
if mb = 'l' then
Img1.Canvas.Pen.color := pnl4.Color
Else
Img1.Canvas.Pen.color := pnl3.Color;
Img1.Canvas.Pen.width := strtoint(edt1.text);
Img1.Canvas.moveto(x,y);
Img1.Canvas.lineto(x1,y1);
end;
If btn7.Down then
Begin
img1.picture.Assign(img2.picture);
img1.Canvas.pen.Width := strtoint(edt1.text);
if mb = 'r' then
img1.Canvas.Pen.color := pnl3.Color
Else
Img1.Canvas.Pen.color := pnl4.color;
if rb1.checked = true then
img1.Canvas.Brush.Style := bsClear
Else
img1.Canvas.Brush.Style := bsSolid;
Img1.Canvas.ellipse(x,y,x1,y1);
end;
If btn8.Down then
Begin
img1.picture.Assign(img2.picture);
img1.Canvas.pen.Width := strtoint(edt1.text);
if mb = 'r' then
img1.Canvas.Pen.color := pnl3.Color
Else
Img1.Canvas.Pen.color := pnl4.color;
if rb1.Checked = true then
img1.Canvas.Brush.Style := bsClear
Else
img1.Canvas.Brush.Style := bsSolid;
img1.Canvas.Rectangle(x,y,x1,y1);
end;
end;
x2 := x;
y2 := y;
end;
procedure TForm1.img1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
Begin
If btn2.Down then
Begin
if button = mbRight then
Img1.Canvas.brush.color := pnl3.Color
Else
Img1.Canvas.brush.color := pnl4.Color;
Img1.Canvas.FloodFill(x, y,Img1.Canvas.Pixels[x,y], fssurface);
end;
If btn3.Down then
Begin
if button = mbRight then
pnl3.Color := Img1.Canvas.pixels[x,y]
Else
pnl4.color := Img1.Canvas.pixels[x,y];
end;
end;
procedure TForm1.img1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
Begin
img2.picture.Assign(img1.Picture);
x1 := x;
y1 := y;
if button = mbRight then
mb := 'r'
Else
mb := 'l';
img1.Canvas.MoveTo(x,y);
Img1MouseMove(Sender,Shift,X,Y);
end;
procedure TForm1.edt1Change(Sender: TObject);
Begin
fat := strtoint(edt1.text);