Canvas Draw TBitmap Multiple Images

0

I would like to capture several images and "put" all of them in one without having to save them first, I capture 6 images placed one above the other according to the position on the screen and saved in a single image, Any idea? I'm using Delphi XE7

function Unir(G1, G2, G3: TGraphic): TBitmap;

begin
  Result := TBitmap.Create;
  with Result do
  try
    Width := Screen.Width;
    Height := Screen.Height;
    Canvas.Draw(0, 0, G1);
    Canvas.Draw(80, 90, G2);
    Canvas.Draw(100, 150, G3);
  except
    FreeAndNil(Result);
    raise;
  end;
end;

In this way I can join 3 images, but I do not have a fixed amount of images, because they are variable, so in this case it would be ideal to use array of images. I'm trying to use the function below, but it fails to call them:

  

Incompatible type Array and Dynamic Array

function UnirTudo(Imagens : array of TGraphic): TBitmap;
var
i : Integer;
begin
  Result := TBitmap.Create;
  with Result do
  try
    Width := Screen.Width;
    Height := Screen.Height;
    for i := 0 to Length(Imagens) - 1 do begin
      Canvas.Draw(0, 0, Imagens[i]);
    end;
  except
    FreeAndNil(Result);
    raise;
  end;
end;
    
asked by anonymous 08.08.2016 / 23:07

0 answers