Sign in to follow this  
Followers 0
narayanjr

img get collection

6 posts in this topic

#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?

Share this post


Link to post
Share on other sites

Try changing the line to this...

$sInfo &= "Size: " & InetGetSize($oImg.src)

Share this post


Link to post
Share on other sites

that worked sadly it is slow but its good enough for now unless some one knows another way

Thanks big

Share this post


Link to post
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.

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

Thanks weaponx works great and its fast.

Share this post


Link to post
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
Sign in to follow this  
Followers 0