// 확대하기(Zoom-In)
procedure TForm1.Button3Click(Sender: TObject);
begin
fZoom:=fZoom+0.25;
WebBrowser1.OleObject.Document.Body.Style.Zoom :=fZoom;
end;
// 정상으로
procedure TForm1.Button4Click(Sender: TObject);
begin
fZoom:=1;
WebBrowser1.OleObject.Document.Body.Style.Zoom :=fZoom;
end;
// Navigate
procedure TForm1.Button1Click(Sender: TObject);
begin
WebBrowser1.Navigate(Edit1.Text);
end;
// Navigate 시작할때..
procedure TForm1.WebBrowser1BeforeNavigate2(Sender: TObject;
const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
Headers: OleVariant; var Cancel: WordBool);
begin
fZoom:=1;
end;
// Navigate 끝날때
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
begin
if pDisp = WebBrowser1.DefaultDispatch then
fZoom:=1;
end;
var
fZoom: Double;
// 축소하기 (Zoom-Out)
procedure TForm1.Button2Click(Sender: TObject);
begin
if(fZoom<0.5)then Exit;
fZoom:=fZoom-0.25;
WebBrowser1.OleObject.Document.Body.Style.Zoom :=fZoom;
end;
// 확대하기(Zoom-In)
procedure TForm1.Button3Click(Sender: TObject);
begin
fZoom:=fZoom+0.25;
WebBrowser1.OleObject.Document.Body.Style.Zoom :=fZoom;
end;
// 정상으로
procedure TForm1.Button4Click(Sender: TObject);
begin
fZoom:=1;
WebBrowser1.OleObject.Document.Body.Style.Zoom :=fZoom;
end;
// Navigate
procedure TForm1.Button1Click(Sender: TObject);
begin
WebBrowser1.Navigate(Edit1.Text);
end;
// Navigate 시작할때..
procedure TForm1.WebBrowser1BeforeNavigate2(Sender: TObject;
const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
Headers: OleVariant; var Cancel: WordBool);
begin
fZoom:=1;
end;
// Navigate 끝날때
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
begin
if pDisp = WebBrowser1.DefaultDispatch then
fZoom:=1;
end;
참조
target=_blank>http://www.swissdelphicenter.ch/en/showcode.php?id=1537
그럼..