文件名称:图片放大镜效果
文件大小:2.49MB
文件格式:RAR
更新时间:2017-08-28 15:45:38
delphi
实现图片的放大镜效果的源码,欢迎下载! procedure TForm1.ImageCopy(BoxCenterX,BoxCenterY, BoxSide: Integer); begin with SourceRect do begin Left:=BoxCenterX-BoxSide; Top:=BoxCenterY-BoxSide; Right:=BoxCenterX+BoxSide; Bottom:=BoxCenterY+BoxSide; end; with DestRect do begin Left:=BoxCenterX-dSide; Top:=BoxCenterY-dSide; Right:=BoxCenterX+dSide; Bottom:=BoxCenterY+dSide; end; ForeImage.Canvas.CopyRect(DestRect, BackImage.Canvas, SourceRect); end; procedure TForm1.ForeImageMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin DoubleBuffered :=True; NewX:=X; NewY:=Y; if msHide then begin OldX:=NewX; OldY:=NewY; msHide:=False; ShowCursor(False); end else begin ImageCopy(OldX, OldY, dSide); end; ImageCopy(NewX, NewY, sSide); OldX:=NewX; OldY:=NewY; end;
【文件预览】:
loginname_hh_zoom.jpg
Project1.exe
Project1.res
Unit1.dfm
01.bmp
Project1.cfg
Unit1.pas
Project1.dpr
Project1.dof