Jump to content

"Getting" Height and Width from a "Pic" control


Recommended Posts

I have a list of Pic files that I am pulling into controls using this command:

$control[$i] = GUICtrlCreatePic($sImageLocation & "mypict.gif", $x, $y, 0, 0)

The last two zeros allow the control to be sized exactly to the height and width of the file; however, when the control is clicked, the size needs to change based on what the original size was. Is there a way to retrieve the "height" and "width" of the control[$i]?

I have tried

_GDIPlus_ImageGetWidth($control[$i])

but this causes the script to crash.

Is there another way that I am missing?

Thanks,

Bob

Edited by YellowLab

You can't see a rainbow without first experiencing the rain.

Link to comment
Share on other sites

You can only use _GDIPlus_ImageGetWidth() for images loaded with another _GDIPlus_...() function, for controls use ControlGetPos()

Edit:Clarified it some...

Edited by AdmiralAlkex
Link to comment
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
 Share

  • Recently Browsing   0 members

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