| 183 |
|
end; |
| 184 |
|
const |
| 185 |
|
PartMatch: array[0..8] of Byte = (0, 3, 6, 1, 4, 7, 2, 5, 8); |
| 186 |
< |
stretch_x: Integer = 50; |
| 186 |
> |
stretch_x: Integer = 1; |
| 187 |
|
stretch_y: Integer = 1; |
| 188 |
|
var |
| 189 |
|
x, y: Word; |
| 227 |
|
row := i mod 3; |
| 228 |
|
if (p2[i].X > 0) or (p2[i].Y > 0) then |
| 229 |
|
begin |
| 230 |
< |
parts[part].x_txmp := p1[i].X - 1; |
| 231 |
< |
parts[part].y_txmp := p1[i].Y - 1; |
| 230 |
> |
parts[part].x_txmp := p1[i].X;// - 1; |
| 231 |
> |
parts[part].y_txmp := p1[i].Y;// - 1; |
| 232 |
|
parts[part].x_pspc := 0; |
| 233 |
|
if col > 0 then |
| 234 |
|
for x := 0 to col - 1 do |
| 237 |
|
if row > 0 then |
| 238 |
|
for y := 0 to row - 1 do |
| 239 |
|
Inc(parts[part].y_pspc, rows[y]); |
| 240 |
< |
parts[part].w := p2[i].X - p1[i].X + 1; |
| 241 |
< |
parts[part].h := p2[i].Y - p1[i].Y + 1; |
| 240 |
> |
parts[part].w := Max(p2[i].X - p1[i].X, 1);// + 1; |
| 241 |
> |
parts[part].h := Max(p2[i].Y - p1[i].Y, 1);// + 1; |
| 242 |
|
parts[part].used := True; |
| 243 |
|
cols[col] := parts[part].w; |
| 244 |
|
rows[row] := parts[part].h; |
| 278 |
|
for row := 0 to 2 do |
| 279 |
|
begin |
| 280 |
|
part := row*3 + col; |
| 281 |
< |
if (row = 1) and (col = 1) then |
| 282 |
< |
StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, |
| 283 |
< |
FImages[0], x, y, parts[part].w * stretch_x, parts[part].h * stretch_y, rfNearest) |
| 284 |
< |
else |
| 285 |
< |
if (row = 1) then |
| 286 |
< |
StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, |
| 287 |
< |
FImages[0], x, y, parts[part].w, parts[part].h * stretch_y, rfNearest) |
| 288 |
< |
else |
| 281 |
> |
if parts[part].used then |
| 282 |
> |
begin |
| 283 |
> |
if (row = 1) and (col = 1) then |
| 284 |
> |
StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, |
| 285 |
> |
FImages[0], x, y, parts[part].w * stretch_x, parts[part].h * stretch_y, rfNearest) |
| 286 |
> |
else |
| 287 |
> |
if (row = 1) then |
| 288 |
> |
StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, |
| 289 |
> |
FImages[0], x, y, parts[part].w, parts[part].h * stretch_y, rfNearest) |
| 290 |
> |
else |
| 291 |
> |
if (col = 1) then |
| 292 |
> |
StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, |
| 293 |
> |
FImages[0], x, y, parts[part].w * stretch_x, parts[part].h, rfNearest) |
| 294 |
> |
else |
| 295 |
> |
CopyRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, |
| 296 |
> |
FImages[0], x, y ); |
| 297 |
> |
if row = 1 then |
| 298 |
> |
y := y + parts[part].h * stretch_y |
| 299 |
> |
else |
| 300 |
> |
y := y + parts[part].h; |
| 301 |
> |
end; |
| 302 |
> |
end; |
| 303 |
> |
if cols[col] > 0 then |
| 304 |
> |
begin |
| 305 |
|
if (col = 1) then |
| 306 |
< |
StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, |
| 291 |
< |
FImages[0], x, y, parts[part].w * stretch_x, parts[part].h, rfNearest) |
| 292 |
< |
else |
| 293 |
< |
CopyRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, |
| 294 |
< |
FImages[0], x, y ); |
| 295 |
< |
if row = 1 then |
| 296 |
< |
y := y + parts[part].h * stretch_y |
| 306 |
> |
x := x + parts[part].w * stretch_x |
| 307 |
|
else |
| 308 |
< |
y := y + parts[part].h; |
| 308 |
> |
x := x + parts[part].w; |
| 309 |
|
end; |
| 300 |
– |
if (part mod 3) = 1 then |
| 301 |
– |
x := x + parts[part].w * stretch_x |
| 302 |
– |
else |
| 303 |
– |
x := x + parts[part].w; |
| 310 |
|
end; |
| 311 |
|
|
| 312 |
|
FreeImage(pspcimage); |