Jump to content

Recommended Posts

Posted (edited)

Seems using GUICtrlSetImage with a empty string resets not only the image but also the initial image size on a GUICtrlCreatePic control.

Ergo: GUICtrlSetImage next use, with a valid image, will display the image in its original size instead of the initial size used at the GUICtrlCreatePic creation time.

... that's it.

---

Code wise example/explanation.

GUICreate('MyGUI')
;
$PicCtrl = GUICtrlCreatePic('MyImage_Initial.ext')
GUISetState()
;
GUICtrlSetImage($PicCtrl, 'MyImage_2.ext')
;; 'MyImage_2.ext' will be rescaled/displayed using the 'MyImage_Initial.ext' image dimensions.
;
GUICtrlSetImage($PicCtrl, '')
;; Clear active 'MyImage_Initial.ext' image dimensions on $PicCtrl.
;
GUICtrlSetImage($PicCtrl, 'MyImage_3.ext')
;; Set new image dimensions, based on 'MyImage_3.ext' image dimentions.
Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Posted

Could you provide an example?

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

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
×
×
  • Create New...