--- oup/current/Global/OniImgClass.pas 2007/05/26 19:28:08 198 +++ oup/current/Global/OniImgClass.pas 2007/05/26 20:41:34 199 @@ -183,7 +183,7 @@ type end; const PartMatch: array[0..8] of Byte = (0, 3, 6, 1, 4, 7, 2, 5, 8); - stretch_x: Integer = 50; + stretch_x: Integer = 1; stretch_y: Integer = 1; var x, y: Word; @@ -227,8 +227,8 @@ begin row := i mod 3; if (p2[i].X > 0) or (p2[i].Y > 0) then begin - parts[part].x_txmp := p1[i].X - 1; - parts[part].y_txmp := p1[i].Y - 1; + parts[part].x_txmp := p1[i].X;// - 1; + parts[part].y_txmp := p1[i].Y;// - 1; parts[part].x_pspc := 0; if col > 0 then for x := 0 to col - 1 do @@ -237,8 +237,8 @@ begin if row > 0 then for y := 0 to row - 1 do Inc(parts[part].y_pspc, rows[y]); - parts[part].w := p2[i].X - p1[i].X + 1; - parts[part].h := p2[i].Y - p1[i].Y + 1; + parts[part].w := Max(p2[i].X - p1[i].X, 1);// + 1; + parts[part].h := Max(p2[i].Y - p1[i].Y, 1);// + 1; parts[part].used := True; cols[col] := parts[part].w; rows[row] := parts[part].h; @@ -278,29 +278,35 @@ begin for row := 0 to 2 do begin part := row*3 + col; - if (row = 1) and (col = 1) then - StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, - FImages[0], x, y, parts[part].w * stretch_x, parts[part].h * stretch_y, rfNearest) - else - if (row = 1) then - StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, - FImages[0], x, y, parts[part].w, parts[part].h * stretch_y, rfNearest) - else + if parts[part].used then + begin + if (row = 1) and (col = 1) then + StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, + FImages[0], x, y, parts[part].w * stretch_x, parts[part].h * stretch_y, rfNearest) + else + if (row = 1) then + StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, + FImages[0], x, y, parts[part].w, parts[part].h * stretch_y, rfNearest) + else + if (col = 1) then + StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, + FImages[0], x, y, parts[part].w * stretch_x, parts[part].h, rfNearest) + else + CopyRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, + FImages[0], x, y ); + if row = 1 then + y := y + parts[part].h * stretch_y + else + y := y + parts[part].h; + end; + end; + if cols[col] > 0 then + begin if (col = 1) then - StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, - FImages[0], x, y, parts[part].w * stretch_x, parts[part].h, rfNearest) - else - CopyRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h, - FImages[0], x, y ); - if row = 1 then - y := y + parts[part].h * stretch_y + x := x + parts[part].w * stretch_x else - y := y + parts[part].h; + x := x + parts[part].w; end; - if (part mod 3) = 1 then - x := x + parts[part].w * stretch_x - else - x := x + parts[part].w; end; FreeImage(pspcimage);