The problem was ‘Vector graphics support’ as you may find in the Component section.
Thanks to the solution provided by Bruce we now can easily ‘stretch’ a graphic to the size we want. And I say ‘graphic’ because ‘picture’ and ‘image’ mean different things in Gambas.
So, why using vector graphics. Simply because they are the thing to use when you want the quality of the background or content of any control that accepts graphics to stay the same, whatever size you apply to it.
In the following example I’ll be using ‘Union-Jack.svg’. You can download the original here:
https://www.freepik.com/free-vector/ill ... 807791.htm.
After unpacking there will be a file 18166.eps. Edit it with a programme like Inkscape and save the result as Union-Jack.svg.
No, I‘m not a subject of her Majesty, but the Union Jack has something in abundance that makes ‘stretching’ (‘resizing’, ‘scaling’, …) other types of graphics hell: oblique lines.
You will see the difference when replacing ‘Union-Jack.svg’ with any other format of Union Jack (.bmp, .jpg, …).
Take a new Form and put on it PictureBox1 and Button1.
Make Button1 small - Width 60 , Height 30
Enter these few lines of code in it’s class.
' Gambas class file
Private MyGraphic As Picture
Public Sub Form_Open()
MyGraphic = Picture.Load(Application.path & "/Union-Jack.svg")
PictureBox1.Picture = MyGraphic.Image.Stretch(PictureBox1.W, PictureBox1.H).Picture
Button1.Picture = MyGraphic.Image.Stretch(Button1.W, Button1.H).Picture
Me.width = Screen.W
Me.height = Screen.H
Me.Picture = MyGraphic.Image.Stretch(Me.W, Me.H).Picture
End
Have a nice weekend