0
I'm using Delphi 11 and I'm trying to get the EdgeBrowser.CapturePreview to save to 
stream and use later.

In the first example, the file saves correctly. From what I can see the .CapturePreview will save to a file or a stream. But, CapturePreview does not appear to Capture to a stream. Any suggestions?


uses Vcl.Edge;

procedure TFormMain.MenuSaveScreenShotClick(Sender: TObject);
 begin
  //This sample works well and saves a file.
  if SaveDialog1.Execute then EdgeBrowser1.CapturePreview(SaveDialog1.FileName);
 end;

在此处输入图像描述

procedure TFormMain.MenuSaveScreenShotClick(Sender: TObject);
 var
   ms:TMemoryStream;
begin
  // Save to Stream...
  ms:=TMemoryStream.Create();
 if dlgSaveScreenshot.Execute then
  EdgeBrowser.CapturePreview(ms);
  ms.Position:=0;
  ms.SaveToFile('test.png');
end;

在此处输入图像描述

4

1 回答 1

0

将您的流保存在事件 CapturePreviewCompleted 上。

于 2022-01-15T08:45:42.510 回答