Jump to content

img get collection


Recommended Posts

#include <IE.au3>
$oIE = _IECreate ("http://www.autoitscript.com/")
$oImg = _IEImgGetCollection ($oIE, 5)
$sInfo = "Src: " & $oImg.src & @CR
$sInfo &= "FileName: " & $oImg.nameProp & @CR
$sInfo &= "Height: " & $oImg.height & @CR
$sInfo &= "Width: " & $oImg.width & @CR
$sInfo &= "Border: " & $oImg.border & @CR
;$sInfo &= "Size: " & $oImg.size
MsgBox(0, "4th Image Info", $sInfo)

is there any way to make the commented line work?

I just made the line up I didnt think that it would but is there a way to make it get the size of the image also?

Link to comment
Share on other sites

I tried this:

#include 
$oIE = _IECreate ("http://www.autoitscript.com/")
$oImg = _IEImgGetCollection ($oIE, 1)
$sInfo = "Src: " & $oImg.src & @CR
$sInfo &= "FileName: " & $oImg.nameProp & @CR
$sInfo &= "Height: " & $oImg.height & @CR
$sInfo &= "Width: " & $oImg.width & @CR
$sInfo &= "Border: " & $oImg.border & @CR
$sInfo &= "Size: " & (FileGetSize ( @UserProfileDir & "\Local Settings\Temporary Internet Files\" & $oImg.nameProp ) / 1024) & " kb"

MsgBox(0, "4th Image Info", $sInfo)

But it loooks like windows is blocking reading from that folder.

Link to comment
Share on other sites

Here you go (found the properties here:http://www.javascriptkit.com/jsref/image.shtml):

#include "IE.au3"
$oIE = _IECreate ("http://www.autoitscript.com/")
$oImg = _IEImgGetCollection ($oIE, 1)
$sInfo = "Src: " & $oImg.src & @CR
$sInfo &= "FileName: " & $oImg.nameProp & @CR
$sInfo &= "Height: " & $oImg.height & @CR
$sInfo &= "Width: " & $oImg.width & @CR
$sInfo &= "Border: " & $oImg.border & @CR
$sInfo &= "Size: " & StringFormat("%.2f", $oImg.fileSize / 1024) & " kb"

MsgBox(0, "4th Image Info", $sInfo)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...