From 6d0bc8acebd5ed3095fd35c593587c5372e7ea05 Mon Sep 17 00:00:00 2001 From: yangjixian Date: Tue, 3 Jan 2012 07:28:43 +0000 Subject: [PATCH] All dot on right position in stretch picture. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2222 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- applications/lazimageeditor/DLBmpUtils.inc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/applications/lazimageeditor/DLBmpUtils.inc b/applications/lazimageeditor/DLBmpUtils.inc index 0854165e1..910dec02c 100644 --- a/applications/lazimageeditor/DLBmpUtils.inc +++ b/applications/lazimageeditor/DLBmpUtils.inc @@ -819,7 +819,7 @@ begin dh := aHeight; Dest.Width := dw; Dest.Height := dh; - m := Trunc(ypos / ih); +{ m := Trunc(ypos / ih); n := Trunc(xpos / iw); for i := ypos to ylen - 1 do begin @@ -834,6 +834,16 @@ begin if (j mod iw) = 0 then k := k + 1; end; + end; } + for i := ypos to ylen - 1 do + begin + LScan1 := Dest.Scanline[i - ypos]; + LScan2 := Src.Scanline[Trunc(i / sh)]; + for j := xpos to xlen - 1 do + begin + k := Trunc(j / sw); + LScan1[j - xpos] := LScan2[k]; + end; end; Dest.InvalidateScanLine; ACanvas.Draw(NewLeft + posx, NewTop + posy, Dest);