Sign in to follow this  
Followers 0
Matrix112

How to get image size?

3 posts in this topic

Hi,

does someone know how to get size of an jpg image?

I only found a Dll function for bmp images, but cant get it to work.

Thats my try for bmp:

Global $x
Global $y
$info = _ImageGetInfo ("C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\test\test.bmp")
MsgBox(0,"test", $info)

Func _ImageGetInfo ($path)
    $dll = DllOpen("comctl32.dll")
    $handle = DllCall($dll, "int", "ImageList_LoadImage", "none", "", "string", $path, "int", 0, "int", 1, "int", "CLR_NONE", "int", "IMAGE_BITMAP", "int", "LR_LOADFROMFILE")
    
    $dllstrx = DllStructCreate("int")
    $dllstry = DllStructCreate("int")
    
    $size = DllCall($dll, "int", "ImageList_GetIconSize", "int", $handle, "ptr", DllStructGetPtr($dllstrx), "ptr",  DllStructGetPtr($dllstry))
    $result = DllStructGetData($dllstrx, 1)
    Return $result
    DllClose($dll)
    
EndFunc

Share this post


Link to post
Share on other sites



You need to have ExtProp.au3.

A very nice tool from Simucal.

good luck

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