Jump to content
Sign in to follow this  
narayanjr

img get collection

Recommended Posts

narayanjr

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

Try changing the line to this...

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

Share this post


Link to post
Share on other sites
narayanjr

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
weaponx

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
weaponx

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
narayanjr

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  

×