Search the Community
Showing results for tags 'svg'.
Found 5 results
-
Lately I have found myself spending way to much time locating and converting my various toolbars and buttons to use SVG images. Part of that time was searching multiple archives only to find the same list of icons, however in different weights and sizes. The Microsoft Fluent UI icon repository is difficult to easily navigate and requires multiple steps to grab an icon... there had to be an easier way. So I wrote one that not only allows one to save SVG files, but also PNG files with an included -x size added to make it super easy when adding to an existing image collection (if you, like me, have projects that are still not quite in the latest version of Delphi). The project requires Delphi 12 (or minimally Delphi 10.4 with Skia4Delphi added) to recompile, I have included a compiled executable as a release asset if you do not have the required Delphi version. There are currently 27,400 individual SVG icons, additionally those that have both a filled and outline version have the option to also generate a "TwoTone" icon. You have complete control over colors and export sizes. https://github.com/skamradt/SVGIconViewer Currently included Icon libraries: Microsoft Fluent UI, Tablar-Icons If you find this project useful, I would appreciate a star. If it saves you time and effort, feel free to buy me a coffee (or several, code signing is so expensive lately). 🙂
-
In an earlier thread I presented an Interface-based access to native Windows (Direct2D) SVG support for Delphi applications. This has now been integrated into the SVGIconImageList components by @Carlo Barazzetta. Carlo is a kind of master of ImageLists (among other things). Have a look at his IconFontsImageList for instance. His SVGIconImageList component was based on the work of Martin Walter who must be a great programmer. His SVG component covered almost every SVG element and was well structured and cleanly written. There were numerous bugs and issues though, which, to a large extent, were fixed over the last few weeks and the code was refactored and optimized. Finally, @Vincent Parrett contributed a virtual version of the Image List, mirroring Delphi's VirtualImageList. So in its current form the component features: An SVGImageCollection component that inherits from Delphi's CustomImageCollection and thus is compatible with VirtualImageList A choice of SVG engines: the pascal one based on Martin's work which is using GDI+ and the native Windows one which is using Direct2D. Other SVG engines can be plugged-in with minimum effort. Excellent design support with a nice and effective SVGImageCollection editor developed by Carlo and the built-in VirtualImageList editor. Support for changing the opacity and color of the SVGs including using GrayScale. If you adopt Material Design for example and you use VCL styles, you can adjust the icon color to the style. Compatibility with older Delphi versions going back to XE6. It is free and open-source Svgs are vastly superior to bitmaps because they are typically tiny text files and scale perfectly. So, you do not need to ship with your application multiple resolutions of your images to match the DPI of the monitors. And there is a vast number of free SVGs to cover most needs. IMHO the combination of SVGImageCollection with Delphi's VirtualImageList is the best available solution (commercial ones included) for building DPI-aware Windows applications. Give it a try.
-
In my application I generate a SVG graphic in a TCppWebBrowser by providing GraphViz dot language code that is converted to SVG by a JavaScript version of GraphViz viz.js. File _test.html shows the original HTML page (dot code and JavaScript code) that produces the SVG output shown in file test.html. In the form with the TCppWebBrowser component I added some buttons to zoom in, out and reset to 100%: //--------------------------------------------------------------------------- void __fastcall TFormViewer::btZoomInClick(TObject *Sender) { ZoomFactor *= 1.1; OleVariant ZoomFac = int(ZoomFactor); CppWebBrowser1->ExecWB(63, OLECMDEXECOPT_DONTPROMPTUSER, ZoomFac, 0); } //--------------------------------------------------------------------------- void __fastcall TFormViewer::btZoomOutClick(TObject *Sender) { ZoomFactor *= 0.9; OleVariant ZoomFac = int(ZoomFactor); CppWebBrowser1->ExecWB(63, OLECMDEXECOPT_DONTPROMPTUSER, ZoomFac, 0); } //--------------------------------------------------------------------------- // void __fastcall TFormViewer::btResizeClick(TObject *Sender) { ZoomFactor = 100; OleVariant ZoomFac = int(ZoomFactor); CppWebBrowser1->ExecWB(63, OLECMDEXECOPT_DONTPROMPTUSER, ZoomFac, 0); } This works fine but for huge networks with hundreds of elements I would like to zoom to a specific element by name (in test.html e.g. to "HE M15". My idea is to change the viewBox attribute of the svg object. So, I need to find the element with the specific name (e.g. "HE M15"), read the x, y coordinates of the text and change the viewBox accordingly. Would this be possible by IHTMLWindow2::execScript (JavaScript code) or other tools to access the DOM... or would it be easier to save the html page, load it in a StringList, search the element and coordinates there and change the viewBox attribute, save the file and load it into the TCppWebBrowser component again? __test.html test.html
-
A new version (1.1) of SVGShellExtensions (Open-Source) has been released with a new component (a very useful SVG Text Editor) and a context-menu to export an SVG file to multiple PNG files. The new Setup is always available on the project page: https://github.com/EtheaDev/SVGShellExtensions The preview panel now has a slider to change the "backlight" of the image and more settings (such as text color attributes, theme, use of native Direct2D). The SVG Text Editor is useful for developers who need to change certain aspects of the icons (such as element colors) or try to change the SVG language and see an instant preview of the changes. Any suggestions for improving these components are welcome!
-
- explorer
- svgiconimagelist
- (and 4 more)
-
I released update 13 of the SVG control package The package contains controls and utilities for using xml based scalable vector graphics in your Delphi applications. Includes packages and demo applications for Delphi 10.3 Rio Added support to the SVG VCL controls for DPI aware applications Updated the demo packages Bug fixes and improvements