[Gambas-user] Need help with resizing Picutre contained by a resizable scrollview

Benoit Minisini gambas at ...1...
Tue Apr 8 00:42:27 CEST 2008


On mardi 8 avril 2008, B. Jack wrote:
> Hotmail has a tag bug...  it truncated some of my pseudocode:
>
> Then what I want to do is have the size and position of Picture1 in an
> Arrange handler such that: when Picture1.Image.W < ScrollView1.W move
> Picutre1 so that Picture1.X=Int(ScrollView.W - Picutre1.W / 2) when
> Picture1.Image.W>= ScrollView1.W set Picture1.X=0
> when Picture1.Image.H < ScrollView1.H move Picutre1 so that
> Picture1.Y=Int(ScrollView.H - Picutre1.H / 2) when Picture1.Image.H>=
> ScrollView1.H set Picture1.Y=0
>
> < is escaped so it doesn't truncate again
>

You must use ScrollView1.ClientW and ScrollView1.ClientH to get the dimension 
of the contents of the ScrollView1. Otherwise you will get the border, if you 
defined a border of course.

Regards,

-- 
Benoit Minisini




More information about the User mailing list