Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Delphi: ActiveX/СОМ/CORBA > twebbrowser Как получить ссылки на которые ведут к


Автор: darkcoder 6.3.2008, 19:30
Как получить ссылки на которые ведут картинки?
<a href="нужно узнать что тут для данной картинки"><img src=""></a>
Код приведенные ниже пытался модифицировать, не вышло.

for i := 0 to EmbeddedWB1.OleObject.Document.Images.Length - 1 do
begin
     Document := Embeddedwb1.Document as IHtmlDocument2;
     // Retrieves the calculated width of the image.
    ImageWidth := Embeddedwb1.OleObject.Document.Images.Item(i).Width;
     // Retrieves the height of the image.
    ImageHeight := Embeddedwb1.OleObject.Document.Images.Item(i).Height;
     // Retrieves the file size of the image.
    ImageFileSize := (Document.Images.Item(i, 0) as IHTMLImgElement).FileSize;
     // Retrieves the entire URL that the browser uses to locate the image
    ImageHref := (Document.Images.Item(i, 0) as IHTMLImgElement).Href;
     // Retrieves a text alternative to the graphic.
    ImageTextAlternative := (Document.Images.Item(i, 0) as IHTMLImgElement).alt;
     // Show image information in a TListbox
    ListBox1.Items.Add(Format('%s : %d x %d Pixels; %s Bytes; %s',
       [ImageHref, ImageWidth, ImageHeight, ImageFileSize, ImageTextAlternative]));
   end;

Автор: darkcoder 7.3.2008, 00:25
решено

Автор: MetalFan 7.3.2008, 08:51
расскажи уж как решил...

Автор: darkcoder 7.3.2008, 14:09
img:= (Embeddedwb1.Document as IHTMLDocument2).images.item(i, 1) AS IHTMLImgElement;
if ((img as IHTMLElement).parentElement.tagName = 'A') then
tmpx:=(((img as IHTMLElement).parentElement as IHTMLAnchorElement).Href);

Автор: MMONSTERR 16.3.2008, 16:05
Здраствуйте .  smile  Не подскажете как можно сохранить картинку из webbrousera (visual basic ).
Может есть какое-то свойство этого объекта Document.images.Item(i) ?  Или может подскажете как можно сохранить весь докумен с картинками на диск, но без диалоговых окон Web.Document.ExecCommand ("SaveAs", True, FileName), чтобы молча и тупо сохранился на диске.

Заранее спасибо !

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)