이미지를 한개 불러서 수정한(부분적으로 오리기)후 다음 이미지를 불러오면
오리기한부분의 값을 그대로 가지고 와서 뿌려줍니다
즉 2번째부터는 이미지부분이 전체가 하얗게됩니다
처음 이미지를 수정한 위치값들을 지우는 방법을 부탁드립니다
procedure TForm1.Button1Click(Sender: TObject);
var
imagebmp : tbitmap;
imagejpg : tjpegimage;
Myrect : TRect;
with imagejpg do begin
LoadFromFile('aa'+trim(ImImagefile)+'.jpg');
imagebmp := tbitmap.Create;
imagebmp.Assign(imagejpg);
with imagebmp do begin
image1.canvas.Draw(0,0,imagejpg);
image1.canvas.Stretchdraw(MyRect,imagejpg);
end;
end;
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Drawing := True;
Image1.Canvas.MoveTo(x,y);
Origin := Point(x,y);
MovePt := Origin;
end;
procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Drawing then
begin
DrawShape(Origin, Point(X,Y), pmCopy);
Drawing := False;
end;
end;
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if Drawing then
begin
DrawShape(Origin, MovePt, pmNotXor);
MovePt := Point(X,Y);
DrawShape(Origin, MovePt, pmNotXor);
end;
end;
procedure TForm1.DrawShape(TopLeft, BottomRight: TPoint; AMode: TPenMode);
begin
With Image1.Canvas do
begin
Pen.Mode := AMode;
copymode := cmwhiteness;
case DrawingTool of
dtRectangle :
begin
Rectangle(TopLeft.X, TopLeft.Y, BottomRight.X, BottomRight.Y);
end;
end;
end;
end;