Jump to content

Скопировать в BMP,JPEG содержимое UniURLFrame


Serg

Recommended Posts

Но это не технологично( Exe!   А к Canvas страницы можно как то долезть?

 

Можно ли адаптировать:

 

 

var
  bm: TBitmap;
  ViewObject: IViewObject;
  SRect: TRect;
  JPEG:TJPEGImage;
begin
   if Browser.Document <> nil then
   try
      Browser.Document.QueryInterface( IViewObject, ViewObject );
      if ViewObject <> nil then
      try
         bm := TBitmap.Create;
         bm.Width := Browser.Width;
         bm.Height := Browser.Height;
         SRect := Rect( 0, 0, bm.Width, bm.Height );
         ViewObject.Draw( DVASPECT_CONTENT, 1, nil, nil, Browser.Handle,
                          bm.Canvas.Handle, @SRect, nil, nil, 0 );
 
         //===========
         JPEG:=TJPEGImage.Create;
         JPEG.Assign(bm);
         JPEG.SaveToFile( Path );
         JPEG.Free;
         //===========
         finally
         bm.Free;
         ViewObject._Release;
      end;
   except
   end;
Link to comment
Share on other sites

И не получится, то что Вы выслали, это работа  с TwebBrowser, разные принципы.

Потому используйте вариант из

FMSoft\Framework\uniGUI\Demos\Desktop\HTML2Image

 

Помимо этого на

wkhtmltopdf.org

Есть dll, которая делает тоже самое (пробовал pdf, получилось)

Использовать dll в проекте достаточно кошерно.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...