How to save a capture the screen of the cell in a bitmap?

1

I would like to capture the entire screen of the phone, but what I have achieved so far only captures the control passed in the function parameter. follow 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;

Any hint is welcome.

    
asked by anonymous 11.11.2018 / 00:49

0 answers