Sign in to follow this  
Followers 0
YellowLab

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

3 posts in this topic

#1 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Edit:Clarified it some...

Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites

Doh! *Slaps Forehead*

So focused on GUI commands forgot to look through windows commands.

Thanks!

Bob


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

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