Jump to content

Recommended Posts

Posted (edited)

Hi everyone,

How to get the image dimension of 32 bits and floating point images?

this returns weird values , like 4294967295 for the width and 0 for height :

#Include <GDIPlus.au3>

$theFile = "C:\Image.tga"

_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile ( $theFile )
$iWidth = _GDIPlus_ImageGetWidth ( $hImage )
$iHeight = _GDIPlus_ImageGetHeight ( $hImage )
_GDIPlus_ImageDispose ( $hImage )
_GDIPlus_Shutdown()

ConsoleWrite ( "Image Dimensions = " & $iWidth " * " & $iHeight & @CRLF )

Same issue with Targa (.tga) images 32bits.

Open EXR Sample images : Sample Images for download

[EDIT1]

Just wanted to add that this doesn't work either :

[EDIT2]

Solved using freeimage.

Edited by jmon
Posted

Exr image format is not supported by GDI+ and that's the reason why you get strange values.

$hImage = _GDIPlus_ImageLoadFromFile ( $theFile )
If @error Then Exit MsgBox(16, "ERROR", "File couldn't be loaded")

should help to see whether image format is supported or not.

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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
  • Recently Browsing   0 members

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