The benefits of using vector graphics - revisited

Post

Posted
Rating:
#1 (In Topic #654)
Regular
Doctor Watson is in the usergroup ‘Regular’
This is a new version of an earlier post that – hopefully – will be deleted

This isn’t about posting a new problem, but why and how to use a solved one.
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.
I’ve made a small project to demonstrate this. Please download and run it.
Attachment
I have used the good old Union-Jack. 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 toggling from SVG to GIF.
You may want to experiment with other formats or sizes. Included are a Union-Jack in .gif and .jpg format and in Large, Medium and small sizes.
The result varies considerably depending on the size of the graphic and of the control used. Large size gif’s or jpg’s may give an acceptable result, but svg will allways be the better choise.

 Old african saying:
You eat an elephant one small bite at a time.
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Regular
stevedee is in the usergroup ‘Regular’

Doctor Watson said

…I have used the good old Union-Jack. 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…

Thanks for your nice, clean, code example Doc

…and good to see that the Union Jack is the right-way-up! …assuming the flag pole is on the left
Online now: No Back to the top
1 guest and 0 members have just viewed this.