Исходники и листинги ::: Delphi ::: Рисовалка

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  unit Unit1;
 
  interface
 
  uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls, ExtCtrls;
 
  type
    TForm1 = class(TForm)
      Image: TImage;
      Label1: TLabel;
      Panel: TPanel;
      Button1: TButton;
      ButtonSave: TButton;
      ColorDialog1: TColorDialog;
      procedure ImageMouseDown(Sender: TObject; Button: TMouseButton;
        Shift: TShiftState; X, Y: Integer);
      procedure ImageMouseMove(Sender: TObject; Shift: TShiftState; X,
        Y: Integer);
      procedure FormCreate(Sender: TObject);
      procedure Button1Click(Sender: TObject);
      procedure PanelClick(Sender: TObject);
      procedure ButtonSaveClick(Sender: TObject);
 
 
 
 
 
 
    private
      { Private declarations }
    public
      { Public declarations }
    end;
 
  var
    Form1: TForm1;
 
  implementation
 
  {$R *.dfm}
 
  procedure TForm1.ImageMouseDown(Sender: TObject; Button: TMouseButton;
    Shift: TShiftState; X, Y: Integer);
  begin
  if Button = mbleft then image.Canvas.MoveTo(x,y);
  end;
 
  procedure TForm1.ImageMouseMove(Sender: TObject; Shift: TShiftState; X,
    Y: Integer);
  begin
  if ssleft in Shift then image.Canvas.LineTo(x,y);
  end;
 
  procedure TForm1.FormCreate(Sender: TObject);
  begin
   image.Canvas.FillRect(image.Canvas.ClipRect);
  end;
 
  procedure TForm1.Button1Click(Sender: TObject);
  begin
  ColorDialog1.color:=image.Canvas.Brush.Color;
  if colorDialog1.Execute then begin
  image.Canvas.Brush.Color:=ColorDialog1.Color;
  image.Canvas.FillRect(image.Canvas.ClipRect);
  end;
  end;
 
  procedure TForm1.PanelClick(Sender: TObject);
  begin
  ColorDialog1.Color:=image.Canvas.Pen.Color;
  if colordialog1.Execute then begin
  Panel.Color:=ColorDialog1.color;
  image.Canvas.Pen.Color:=colordialog1.color;
  end;
  end;
  procedure TForm1.ButtonSaveClick(Sender: TObject);
  begin
  Image.Picture.SaveToFile('Ðèñóíîê.bmp');
  end;
 
  end.
<<< Предыдущая работа

Вернуться в галерею исходников
Рисовалка
Автор: Kripton
Город: Томск
Дата: 16.01.2007  08:45
Комментариев: 0
Просмотров: 184
Оценка: 0 (0|0|0|0|0) [0]

Вернуться на главную
Авторский комментарий к работе: смотрите работу
Вы не можете оценивать

КОММЕНТАРИИ К РАБОТЕ:
Нет комментариев