TWebBrowser save to EMF
- From: "Thomas Mahle" <thomahl05@xxxxxxxx>
- Date: 29 Nov 2005 05:26:44 -0800
Hello,
I make desperate efforts to save the Canvas from a TWebBrowser to an
EMF. That´s about the size of it:
procedure TForm1.Button7Click(Sender: TObject);
var
sourceDrawRect: TRect;
mf : TMetaFile;
mfCanvas : TMetafileCanvas;
ViewObject : IViewObject;
begin
with WebBrowser1 do
begin
Height := OleObject.Document.ParentWindow.Screen.Height;
Width := OleObject.Document.ParentWindow.Screen.Width;
mf := TMetafile.Create();
try
sourceDrawRect := Rect(0, 0, Width, Height);
mf.MMWidth := Width;
mf.MMHeight := Height;
mfCanvas := TMetafileCanvas.Create(mf, GetDC(0));
Webbrowser1.Document.QueryInterface(IViewOBject, ViewObject);
if ViewObject <> nil then
OleCheck(ViewObject.Draw(DVASPECT_CONTENT, 1, nil, nil,
Self.Handle,
mfCanvas.Handle,
@sourceDrawRect, nil, nil, 0));
mfCanvas.Free;
mf.SaveToFile('.\test.emf');
finally
mf.Free;
end;
end;
end;
If I have a look at the EMF file I can see that the function BitBlt is
used and this is not wanted. I have no idea how I can stop this
behaviour and save a "real" EMF.
Could someone please help me?
Thanks,
Thomas
.
- Follow-Ups:
- Re: TWebBrowser save to EMF
- From: Rob Kennedy
- Re: TWebBrowser save to EMF
- From: Bjørge
- Re: TWebBrowser save to EMF
- From: J French
- Re: TWebBrowser save to EMF
- Prev by Date: Re: Where to call RestoreDesktop?
- Next by Date: Re: Where to call RestoreDesktop?
- Previous by thread: Software protection against cracks and piracy
- Next by thread: Re: TWebBrowser save to EMF
- Index(es):