Vector graphics support ?

Ask about the individual Gambas components here.
User avatar
PJBlack
Posts: 131
Joined: Tuesday 09th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: Vector graphics support ?

Post by PJBlack » Wednesday 21st April 2021 3:10pm

have had the same problem with picturebox ... picture inverse und form black on black ... problem was solved by creating a new form ...

Doctor Watson
Posts: 60
Joined: Wednesday 22nd August 2018 7:55am

Re: Vector graphics support ?

Post by Doctor Watson » Thursday 22nd April 2021 11:58am

Hi PJBlack
I already tried that and even a whole new project.
Same - negative - result.

To all : I'll be away for a couple of days. :D
Old african saying:
You eat an elephant one small bite at a time.

User avatar
BruceSteers
Posts: 476
Joined: Thursday 23rd July 2020 5:20pm

Re: Vector graphics support ?

Post by BruceSteers » Friday 23rd April 2021 9:26am

I also have issues using Image but not using Picture

' Gambas class file
Private MyGraphic As Picture
 
Public Sub Form_Open()

  MyGraphic = Picture.Load(Application.path & "/GB_FLAG.svg") 'or take any other graphic

  PictureBox1.Picture = MyGraphic.Image.Stretch(PictureBox1.W, PictureBox1.H).Picture
  Button1.Picture = MyGraphic.Image.Stretch(Button1.W, Button1.H).Picture

End

Wishing well
Bruce

If at first you don't succeed , try it differently.

User avatar
BruceSteers
Posts: 476
Joined: Thursday 23rd July 2020 5:20pm

Re: Vector graphics support ?

Post by BruceSteers » Friday 23rd April 2021 9:33am

There's a big difference between an Image and a Picture that is hard to explain.

I see it like if I have a Picture and I look at it then i have an "Image" of that "Picture" in my head
But the "picture" is the real thing while the "image" is not

Or maybe I can get an "Image" of something in my head and make a "Picture" from it. but the "Image" is not real only the "Picture" is once drawn.

hmm , like i say , it's hard to explain.

Suffice to say , Use the "Picture" property/class for final image rendering and the "Image" property to manipulate (colour/stretch/etc)
Wishing well
Bruce

If at first you don't succeed , try it differently.

Doctor Watson
Posts: 60
Joined: Wednesday 22nd August 2018 7:55am

Re: Vector graphics support ?

Post by Doctor Watson » Sunday 25th April 2021 8:11am

Congratulations Bruce! That one needed some thinking over indeed.
There is unfortunately almost nothing to be found on how to use ‘stretch’ in the Gambas documentation, certainly no example code.
Now that the right way of using the ‘stretch’ property has been found, I’d like to explain why I wanted to be able to use vector graphics. I’ll put it in a post in the General section, so perhaps others may benefit.

P.S. I just came across what looks to me like the best Gambas manual till now. It’s in German, but the authors are working on an English translation. Certainly well worth it to pay a visit.
https://gambas-buch.de/dwen/doku.php?id=start. It has some examples on ‘stretch’.

Have a nice weekend.
Old african saying:
You eat an elephant one small bite at a time.

Post Reply