procedure TForm1.Timer1Timer(Sender: TObject);
var Point, Distance: TPoint; Value: Cardinal;
begin
GetCursorPos(Point);
Point := ScreenToClient(Point);
Distance := Classes.Point(0, 0);
if Point.X > Width then
Distance.X := Point.X - Width
else
if Point.X < 0 then
Distance.X := Point.X * -1;
if Point.Y > Height then
Distance.Y := Point.Y - Height
else
if Point.Y < 0 then
Distance.Y := Point.Y * -1;
Value := (Distance.X + Distance.Y) div 2;
if Value > 230 then Value := 230;
AlphaBlendValue := 255 - Value; end;