[Gambas-user] PictureBox

Jerry Betzer j.betzer at comcast.net
Thu Aug 26 17:20:01 CEST 2021


Thanks all (Bruce, BruceS, and Gianluigi) for your suggestions.  I will (eventually) try and/or look at it all.
-Jerry

>     On 08/26/2021 8:10 AM Bruce Steers <bsteers4 at gmail.com> wrote:
> 
> 
> 
> 
>     On Thu, 26 Aug 2021 at 15:56, bb <adamnt42 at gmail.com mailto:adamnt42 at gmail.com > wrote:
> 
>         > > On Thu, 2021-08-26 at 07:12 -0700, Jerry Betzer wrote:
> >         > Apologies in advance if I have selected the wrong address for this e-
> >         > mail.
> >         > I am a novice Gambas user and even more novice member of this user
> >         > list.
> >         > I am looking for help working with the PictureBox class.  I got off
> >         > to a pretty quick and easy start displaying my images (.jpg files)
> >         > but I am having difficulty fitting my pictures within the picture box
> >         > container in a proportional way.  Per the
> >         >http://gambaswiki.org/comp/gb.qt4/picturebox link it looked like I should
> >         > use the "Mode" attribute (specifically PictureBox1.Mode =
> >         > PictureBox.Contain).
> >         > When I run my program I get the following error:
> >         > unknown symbol "Mode" in class "PictureBox"
> >         >
> >         > My OS is:  Linux Mint 18 'sarah'
> >         > 'cinnamon 64 bit'
> >         >
> >         > cat /etc/os-release yields:
> >         > NAME = "ubuntu"
> >         > VERSION = "16.04 LTS (Xenia Xerus)"
> >         >
> >         > Gambas version:  3.8.4                   <----------------- TRUE?
> >         >
> >         > Code snippet:
> >         > Dim strMyString As String
> >         > strMyString = FileChooser1.Value
> >         > PictureBox1.Picture = Picture[strMyString]
> >         > PictureBox1.Mode = 3
> >         >
> >         > NOTE:  I have tried substituting PictureBox.Contain for the magic
> >         > number 3.
> >         >
> >         > Thanks in advance for any help.
> >         > -Jerry
> >         > ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> >         You are using an incredibly old version of Gambas! (Typical Mint)
> >         I doubt whether PictureBox back then had much.
> >         Try and update to a more recent version.
> > 
> >         bruce
> > 
> >     > 
>     He's right that is pretty old.
>     Try this link...
>     https://launchpad.net/~gambas-team/+archive/ubuntu/gambas3
> 
>     follow the instructions "Adding this PPA to your system" to upgrade to gambas 3.16 stable.
> 
> 
>     But you will probably find your issue it the container/panel your picture box is in.
>     It takes a little experimentation to make sure your picture box is not in a panel that will stretch the image even if Contain is set.
>     try setting the parent panel Arrangement to Arrange.None and Expand = false.
>     If you are not sure if it is the panel shape set the panels background to a temporary colour to highlight it's shape.
> 
>     Best of luck
>     BruceS  (a different Bruce)
> 
> 
>     ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210826/17a5a8a5/attachment-0001.htm>


More information about the User mailing list