Utilisation de TPath avec Delphi Rio / Using TPath with Delphi Rio
Ce programme, je l'ai écrit surtout dans le but de tester les possibilités du composant TPath. La genèse de ce petit essai n'avait rien à voir avec une customisation d'image, mon objectif était de voir ce que TPath pouvait m'apporter, je voulais utiliser ce composant moins gourmand en octets qu'une liste d'image au sein d'un style. De fil en aiguille, pour tenter de percer les différentes possibilités, d'un simple affichage d'un TPath avec saisie de la propriété Data dans un mémo je suis passé à la colorisation, la sauvegarde et même le chargement d'un fichier SVG (attention un fichier simple, l'objectif n'étant pas de faire un lecteur de fichier SVG). La colorisation m'a poussé à créer mes dialogues de couleurs (pas si évident que cela cette chose) et étudier de près les gradients, considérez cela comme un bonus.
Les fichiers SVG que vous pourrez traiter je les trouve surtout à cette adresse http://materialdesignicons.com/
Sur l'image vous retrouvez le SVG proposé par Jim McKeeth dans son blog http://delphi.org/2019/02/delphis-big-day-with-a-little-svg-fun/ Ce programme a été réalisé avec la version 10.3.1 de Delphi je ne suis pas sûr qu'elle soit rétro-compatible mais ce n'est qu'à partir de la version Seattle qu'apparaissent certaines unités nécessaires
This program, I wrote it mostly in order to test the possibilities of the TPath component. The genesis of this little test had nothing to do with a customization of image, my goal was to see what TPath could bring me, I wanted to use this component less greedy in bytes than a list of image within of a style. One thing or another, in an attempt to break through the different possibilities, from a simple display of a TPath with the entry of the Data property in a memo I switched to coloring, saving and even loading an SVG file ( be careful a simple file, the goal is not to make an SVG file reader). The colorization pushed me to create my color dialog (not so obvious as this thing) and to study the gradients closely, consider it a bonus.
SVG files that you can process I find them especially at this address http://materialdesignicons.com/
On the image you find the SVG proposed by Jim McKeeth in his blog http://delphi.org/2019/02/delphis-big-day-with-a-little-svg-fun/ This program was realized with Delphi 10.3.1 I'm not sure if it's backwards compatible, but it's only from the Seattle version that some of the necessary units appear