Browse Subversion Repository
Diff of /Unit1.pas
Parent Directory
| Revision Log
| Patch
| 44 |
|
|
| 45 |
procedure TForm1.Button1Click(Sender: TObject); |
procedure TForm1.Button1Click(Sender: TObject); |
| 46 |
var |
var |
| 47 |
s: TPngImage; |
s: TGraphic; |
| 48 |
|
p: TPicture; |
| 49 |
i: Integer; |
i: Integer; |
| 50 |
begin |
begin |
| 51 |
if OpenPictureDialog1.Execute = true then |
if OpenPictureDialog1.Execute = true then |
| 52 |
for i := 0 to OpenPictureDialog1.Files.Count - 1 do |
for i := 0 to OpenPictureDialog1.Files.Count - 1 do |
| 53 |
begin |
begin |
| 54 |
s := TPngImage.Create; |
if ExtractFileExt(OpenPictureDialog1.Files[i]) = '.png' then |
| 55 |
|
s:=TPngImage.Create |
| 56 |
|
else |
| 57 |
|
begin |
| 58 |
|
p:=TPicture.Create; |
| 59 |
|
p.LoadFromFile(OpenPictureDialog1.FileName); |
| 60 |
|
s:=p.Graphic; |
| 61 |
|
end; |
| 62 |
s.LoadFromFile(OpenPictureDialog1.Files[i]); |
s.LoadFromFile(OpenPictureDialog1.Files[i]); |
| 63 |
List.Add(s); |
List.Add(s); |
| 64 |
Label2.Caption := IntToStr(List.Count); |
Label2.Caption := IntToStr(List.Count); |
| 115 |
procedure TForm1.Execute(aCount: integer); |
procedure TForm1.Execute(aCount: integer); |
| 116 |
var |
var |
| 117 |
i: Integer; |
i: Integer; |
| 118 |
s: TPngImage; |
s: TGraphic; |
| 119 |
bmp: TBitmap; |
bmp: TBitmap; |
| 120 |
j: Integer; |
j: Integer; |
| 121 |
k, m: Integer; |
k, m: Integer; |
| 122 |
label label1; |
label label1; |
| 123 |
|
procedure Draw; |
| 124 |
|
var |
| 125 |
|
p: TPngImage; |
| 126 |
|
t: TBitmap; |
| 127 |
|
begin |
| 128 |
|
if s is TPngImage then |
| 129 |
|
(s as TPngImage).Draw(bmp.Canvas, Rect(i * s.Width, j * s.Height, (i + 1) * s.Width, |
| 130 |
|
(j + 1) * s.Height)) |
| 131 |
|
else |
| 132 |
|
begin |
| 133 |
|
t:=TBitmap.Create; |
| 134 |
|
t.Assign(s); |
| 135 |
|
bmp.Canvas.Draw(i*s.Width,j*s.Height,t); |
| 136 |
|
end; |
| 137 |
|
end; |
| 138 |
begin |
begin |
| 139 |
if List.Count = 0 then |
if List.Count = 0 then |
| 140 |
Exit |
Exit |
| 152 |
if k <= List.Count - 1 then |
if k <= List.Count - 1 then |
| 153 |
begin |
begin |
| 154 |
s := List[k]; |
s := List[k]; |
| 155 |
inc(k) |
inc(k); |
| 156 |
end |
end |
| 157 |
else |
else |
| 158 |
goto label1; |
goto label1; |
| 159 |
s.Draw(bmp.Canvas, Rect(i * s.Width, j * s.Height, (i + 1) * s.Width, |
Draw; |
|
(j + 1) * s.Height)); |
|
| 160 |
end; |
end; |
| 161 |
label1: |
label1: |
| 162 |
Image1.Picture.Bitmap.Assign(bmp); |
Image1.Picture.Bitmap.Assign(bmp); |
|
|
Legend:
| Removed from v.1 |
|
| changed lines |
| |
Added in v.2 |
|
|
| |