Jump to content
Sign in to follow this  

How to get image size?

Recommended Posts



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

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.