Returns a collection object variable representing the IMG tags in the document or a single image by index.
#include <IE.au3>
_IEImgGetCollection(ByRef $o_object [, $i_index = -1])
| $o_object | Object variable of an InternetExplorer.Application, Window, Frame or iFrame object |
| $i_index | [optional] specifies whether to return a collection or indexed instance 0 or positive integer returns an indexed instance -1 = (Default) returns a collection |
| Success: | Returns an object variable with a collection of all IMG tags in the document, @EXTENDED = img count |
| Failure: | Returns 0 and sets @ERROR |
| @Error: | 0 ($_IEStatus_Success) = No Error |
| 3 ($_IEStatus_InvalidDataType) = Invalid Data Type | |
| 5 ($_IEStatus_InvalidValue) = Invalid Value | |
| 7 ($_IEStatus_NoMatch) = No Match | |
| @Extended: | Contains invalid parameter number |
; *******************************************************
; Example 1 - Create browser at AutoIt homepage, get a reference to
; the 6th Image on the page (note: the first image is index 0)
; and display information about it
; *******************************************************
#include <IE.au3>
Local $oIE = _IECreate("http://www.autoitscript.com/")
Local $oImg = _IEImgGetCollection($oIE, 5)
Local $sInfo = "Src: " & $oImg.src & @CR
$sInfo &= "FileName: " & $oImg.nameProp & @CR
$sInfo &= "Height: " & $oImg.height & @CR
$sInfo &= "Width: " & $oImg.width & @CR
$sInfo &= "Border: " & $oImg.border
MsgBox(0, "4th Image Info", $sInfo)
; *******************************************************
; Example 2 - Create browser at AutoIt homepage, get Img collection
; and display src URL for each
; *******************************************************
#include <IE.au3>
$oIE = _IECreate("http://www.autoitscript.com/")
Local $oImgs = _IEImgGetCollection($oIE)
Local $iNumImg = @extended
MsgBox(0, "Img Info", "There are " & $iNumImg & " images on the page")
For $oImg In $oImgs
MsgBox(0, "Img Info", "src=" & $oImg.src)
Next