[Gambas-user] Resizing image in scrollview

B. Jack gau_veldt at ...67...
Fri Apr 4 01:53:34 CEST 2008


I am having trouble with resizing images to resized parents because the image size units are not the same as the window/form size units.

I have a form with various V-Slide and H-Slide partitioned child objects.  The image preview pane is a child of a scrollview (so large images may be panned).  This scrollview is ultimately a child of one of the VSliders/HSliders on the form.

What I need to do is have a Picture within the scrollview that centers any image smaller than the client area after any Arrange activity.  For any image larger than the client area the Picture object is maximized to the image size so the ScrollView will make the image pannable.  The problem with just setting the Extend attribute is then that a larger image will be cut off (and won't be scrollable).  Trying to set the H and W (or Width and Height) of the child Picture in an Arrange handler also doesn't seem to work right since the unit size of the image in the Picture and the Parent container do not correlate.

Is the only option to set the stretch attribute and have it chunky-scaled?


_________________________________________________________________
If you like crossword puzzles, then you'll love Flexicon, a game which combines four overlapping crossword puzzles into one!
http://g.msn.ca/ca55/208


More information about the User mailing list