function TViewMain.Press(const Event: TInputPressRelease): Boolean;
var
Image: TRGBImage;
XMiddle, YMiddle: Integer;
SaveUrl: String;
begin
Result := inherited;
if Result then Exit;
if Event.IsKey(keyF5) then
begin
Image := Container.SaveScreen;
try
if (Image.Width > 10) and (Image.Height > 10) then
begin
XMiddle := Image.Width div 2;
YMiddle := Image.Height div 2;
Image.HorizontalLine(XMiddle - 4, XMiddle + 4, YMiddle, Yellow);
Image.VerticalLine(XMiddle, YMiddle - 4, YMiddle + 4, Yellow);
end;
SaveUrl := ApplicationConfig('screenshot_with_crosshair.png');
SaveImage(Image, SaveUrl);
WritelnLog('Saved to ' + SaveUrl);
finally
FreeAndNil(Image);
end;
Exit(true);
end;
end;