Автор работы: Пользователь скрыл имя, 18 Ноября 2009 в 19:23, Не определен
Курсовая работа по программе Паскаль
end;
end.
задача №11
unit PaintUnit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, ExtDlgs, Grids, TeeProcs, TeEngine, Chart, ActnList,
Menus, Buttons, ComCtrls;
type
TPaintMainForm = class(TForm)
Image1: TImage;
Label1: TLabel;
Edit1: TEdit;
ScrollBar1: TScrollBar;
Label2: TLabel;
Edit2: TEdit;
ScrollBar2: TScrollBar;
Label3: TLabel;
Edit3: TEdit;
ScrollBar3: TScrollBar;
Panel1: TPanel;
Label4: TLabel;
ActionList1: TActionList;
Action1: TAction;
Action2: TAction;
Action3: TAction;
Action4: TAction;
Action6: TAction;
Action7: TAction;
Action8: TAction;
Action9: TAction;
Edit4: TEdit;
UpDown1: TUpDown;
Label5: TLabel;
SpeedButton3: TSpeedButton;
Action5: TAction;
Bevel1: TBevel;
Bevel2: TBevel;
procedure FormCreate(Sender: TObject);
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure ScrollBar1Change(Sender: TObject);
procedure ScrollBar3Change(Sender: TObject);
procedure ScrollBar2Change(Sender: TObject);
procedure
Action1Execute(Sender: TObject);
procedure Action4Execute(Sender: TObject);
procedure Action6Execute(Sender: TObject);
procedure Action7Execute(Sender: TObject);
procedure Action8Execute(Sender: TObject);
procedure Action9Execute(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure Action5Execute(Sender: TObject);
procedure SpeedButton5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
PaintMainForm: TPaintMainForm;
implementation
uses PaintUnit2;
{$R *.DFM}
procedure TPaintMainForm.FormCreate(
begin
UpDown1.Associate:=Edit4;
UpDown1.Min:=10;
UpDown1.Max:=100;
UpDown1.Increment:=5;
Image1.Canvas.FillRect(
Image1.Canvas.Pen.Style:=
end;
var drag:boolean=false;
procedure TPaintMainForm.
Shift: TShiftState; X, Y: Integer);
Var a,code1:integer;
c:Tcolor;
begin
c:=Image1.Canvas.Pen.Color;
val (edit4.text,a,code1);
if code1=0 then
drag:=true;
image1.Canvas.MoveTo(x,y);
end;
procedure TPaintMainForm.
Y: Integer);
begin
if drag then image1.Canvas.LineTo(x,y);
end;
procedure TPaintMainForm.Image1MouseUp(
Shift: TShiftState; X, Y: Integer);
begin
drag:=false;
end;
procedure TPaintMainForm.
var red,green,blue :byte;
c:tcolor;
begin
red:=scrollbar1.Position;
green:=scrollbar2.Position;
blue:=scrollbar3.Position;
edit1.Text:=inttostr(red);
edit2.Text:=inttostr(green);
edit3.Text:=inttostr(blue);
c:= rgb(red,green,blue);
image1.Canvas.brush.Color:=c;
panel1.Color:=c;
image1.canvas.pen.color:=C;
end;
procedure TPaintMainForm.
var red,green,blue :byte;
c:tcolor;
begin
red:=scrollbar1.Position;
green:=scrollbar2.Position;
blue:=scrollbar3.Position;
edit1.Text:=inttostr(red);
edit2.Text:=inttostr(green);
edit3.Text:=inttostr(blue);
c:= rgb(red,green,blue);
image1.Canvas.brush.Color:=c;
panel1.Color:=c;
image1.canvas.pen.color:=C;
end;
procedure TPaintMainForm.
var red,green,blue :byte;
c:tcolor;
begin
red:=scrollbar1.Position;
green:=scrollbar2.Position;
blue:=scrollbar3.Position;
edit1.Text:=inttostr(red);
edit2.Text:=inttostr(green);
edit3.Text:=inttostr(blue);
c:= rgb(red,green,blue);
image1.Canvas.brush.Color:=c;
panel1.Color:=c;
image1.canvas.pen.color:=C;
end;
procedure TPaintMainForm.Action1Execute(
begin
Image1.Canvas.FillRect(
end;
procedure TPaintMainForm.Action4Execute(
begin
Image1.Canvas.FillRect(
PaintMainForm.Close;
end;
procedure TPaintMainForm.Action6Execute(
begin
Image1.Canvas.Pen.Style:=
end;
procedure TPaintMainForm.Action7Execute(
begin
Image1.Canvas.Pen.Style:=
end;
procedure TPaintMainForm.Action8Execute(
begin
Image1.Canvas.Pen.Style:=
end;
procedure TPaintMainForm.Action9Execute(
begin
Image1.Canvas.Pen.Style:=
end;
procedure TPaintMainForm.
begin
if SpeedButton3.Down=True then Image1.Canvas.Pen.Width:=10;
if SpeedButton3.Down=False then Image1.Canvas.Pen.Width:=1;
end;
procedure TPaintMainForm.Action5Execute(
begin
PaintHelpForm.Show;
end;
procedure TPaintMainForm.
begin
Image1.Canvas.FillRect(
Image1.Canvas.Brush.Color:=
Image1.Canvas.Pen.Color:=
Panel1.Color:=clBlack;
end;
end.
Информация о работе Программирование на языках высокого уровня