{Экранная лупа. На основе утилиты Zarko Gajic:
http://delphi.about.com/od/graphics/l/aa120198.htm}

unit LENS;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ComCtrls, StdCtrls, ExtCtrls;

type
  TZoom = class(TForm)
    Image: TImage;
    Timer1: TTimer;
    procedure FormHide(Sender: TObject);
    procedure FormResize(Sender: TObject);
    procedure FormMouseWheelUp(Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
    procedure FormMouseWheelDown(Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
    procedure Timer1Timer(Sender: TObject);
  private
  public
  end;

var
  Zoom: TZoom;
  Srect, Drect: TRect;
  iWidth, iHeight, DmX, DmY: Integer;
  iTmpX, iTmpY: Real;
  C: TCanvas;
  hDesktop: hWnd;
  Kursor: TPoint;
  KU: byte = 2;

implementation

{$R *.DFM}


procedure TZoom.FormHide(Sender: TObject);
begin
  Timer1.Enabled := False;
end;

procedure TZoom.FormResize(Sender: TObject);
begin
  Image.Picture := nil;
end;


procedure TZoom.FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
  MousePos: TPoint; var Handled: Boolean);
begin
  if KU > 2 then dec(KU);
end;


procedure TZoom.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
  MousePos: TPoint; var Handled: Boolean);
begin
  if KU < 16 then inc(KU);
end;


procedure TZoom.Timer1Timer(Sender: TObject);
begin
  if not IsIconic(Application.Handle) then begin
    GetCursorPos(Kursor);
    iWidth := Image.Width;
    iHeight := Image.Height;
    Drect := Rect(0,0,iWidth,iHeight);
    iTmpX := iWidth / (KU * 2);
    iTmpY := iHeight / (KU * 2);
    Srect := Rect(Kursor.x,Kursor.y,Kursor.x,Kursor.y);  // Вместо этих двух операторов
    InflateRect(Srect,Round(iTmpX),Round(iTmpY));        // можно следующий один...
    //Srect := Rect(Kursor.x-Round(iTmpX),Kursor.y-Round(iTmpY),
    //              Kursor.x+Round(iTmpX),Kursor.y+Round(iTmpY));
    {Сместить Srect, если выходит за пределы экрана}
    if Srect.Left < 0 then OffsetRect(Srect,-Srect.Left,0);
    if Srect.Top < 0 then OffsetRect(Srect,0,-Srect.Top);
    if Srect.Right > Screen.Width then OffsetRect(Srect,-(Srect.Right-Screen.Width),0);
    if Srect.Bottom > Screen.Height then OffsetRect(Srect,0,-(Srect.Bottom-Screen.Height));
    C := TCanvas.Create;
    hDesktop:= GetDesktopWindow;
    try
      C.Handle := GetDC(hDesktop);
      Image.Canvas.CopyRect(Drect,C,Srect);
    finally
      ReleaseDC(hDesktop,C.Handle);  {!!!}
      C.Free;
    end;
    with Image.Canvas do begin
      Pen.Width := KU;
      Pen.Mode := pmNotXor;
      Pen.Color := clRed;
      DmX := KU*(Kursor.X-Srect.Left);
      DmY := KU*(Kursor.Y-Srect.Top);
      MoveTo(DmX-(iWidth div 8),DmY);
      LineTo(DmX+(iWidth div 8),DmY);
      MoveTo(DmX,DmY-(iHeight div 8));
      LineTo(DmX,DmY+(iHeight div 8));
    end;
  end;
end;

end.
