1
I would like to capture the entire screen of the phone, but what I’ve achieved so far only captures the control passed in the function parameter. follows the code below:
//USO:
var
B: TBitmap;
begin
B:= MakeScaleScreenshot(Self);
Image1.Bitmap.Assign(B);
B.DisposeOf;
end;
//FUNCAO:
function MakeScaleScreenshot(Sender: TControl): TBitmap;
var
fScreenScale: Single;
function GetScreenScale: Single;
var
ScreenService: IFMXScreenService;
begin
Result := 1;
if TPlatformServices.Current.SupportsPlatformService (IFMXScreenService,
IInterface(ScreenService)) then
Result := ScreenService.GetScreenScale;
end;
begin
fScreenScale := GetScreenScale;
Result:= TBitmap.Create(Round(Sender.Width*fScreenScale),
Round(Sender.Height*fScreenScale));
Result.Clear(0);
if Result.Canvas.BeginScene then
try
Sender.PaintTo(Result.Canvas, RectF(0,0,Result.Width,Result.Height));
finally
Result.Canvas.EndScene;
end;
end;
Whatever hint is welcome.