[Gambas-user] Having a bit of trouble with ImageView ZoomfFit

Bruce adamnt42 at gmail.com
Wed May 1 13:13:54 CEST 2019


Basically, I have a .pic file and want to load it in an imageview 
control and then make it fit the current size of the imageview control. 
In other words, no matter what size the user has made the active form, 
the "pic" should be rescaled to fit the imageview control current size.

I am loading the imageview.image like this pseudo code:

1) user selects the object that identifies the image to load (Note the 
indirection there.)
2) code detects that a new image needs to be loaded, and
2a) calculates the path to the correct .pic file
2b) the .pic file is loaded into a Picture object - say fred
2c) (Here we go!) The imageview.image is set to fred.image
Now that all works. But now we need to rescale it to fit the curent size 
of the imageview.
I thought that (ahem) MyImageView.ZoomFit was supposed to do it.
But, the display shows it as if it was zoomed out to about 800m. IOW its 
a little block in the middle of the imageview control.
Now it gets interesting (not!). If I insert a Wait between the .image= 
and the .zoomfit of a "significant" pause then the image is rendered 
correctly. Great but pretty suboptimal.
Especially when the pause is (depending on system load) around 0.6 seconds.

This is infuriating. Totally. In fact even more infuriating than whether 
a bad memory bank switch could ever possibly result in a segfault. ( :-) )

Bug or...?
b


More information about the User mailing list