{"id":17313209,"url":"https://github.com/tannerhelland/vb6-svg","last_synced_at":"2026-03-14T18:11:01.834Z","repository":{"id":147267084,"uuid":"470280675","full_name":"tannerhelland/vb6-svg","owner":"tannerhelland","description":"SVG and SVGZ support for VB6 projects (c/o resvg)","archived":false,"fork":false,"pushed_at":"2024-12-31T01:19:10.000Z","size":7364,"stargazers_count":13,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-27T01:24:33.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Visual Basic 6.0","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tannerhelland.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-15T18:15:25.000Z","updated_at":"2025-01-28T08:26:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"86009f7f-a0a2-4335-bed3-ab6d9db2ac48","html_url":"https://github.com/tannerhelland/vb6-svg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tannerhelland%2Fvb6-svg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tannerhelland%2Fvb6-svg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tannerhelland%2Fvb6-svg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tannerhelland%2Fvb6-svg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tannerhelland","download_url":"https://codeload.github.com/tannerhelland/vb6-svg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248695438,"owners_count":21146954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T12:46:06.668Z","updated_at":"2026-03-14T18:10:56.791Z","avatar_url":"https://github.com/tannerhelland.png","language":"Visual Basic 6.0","funding_links":[],"categories":[],"sub_categories":[],"readme":"## VB6-SVG provides full SVG (and SVGZ) support for VB6 projects\r\n\r\nThis is possible thanks to resvg, a comprehensive portable SVG library by Yevhenii Reizner:\r\n\r\nhttps://github.com/linebender/resvg\r\n\r\nresvg is available under an MPL-2 license.  Please see [resvg-LICENSE.md](https://github.com/tannerhelland/vb6-svg/blob/main/resvg-LICENSE.md) for full details.\r\n\r\n![image](https://user-images.githubusercontent.com/1930029/158446300-b6d995ba-bc65-4d6b-b0bc-bf8e93816f20.png)\r\n\r\n### System requirements\r\n\r\nThis project is 100% portable.  You simply need to ship `resvg.dll` alongside your application (perhaps in an `/App` subfolder).\r\n\r\nThis project has been tested on Win 7, 10, and 11.  It theoretically supports Windows Vista, but testing this is TBD.\r\n\r\nThis project will not work on Windows XP.\r\n\r\n### How to use VB6-SVG\r\n\r\nAn interactive demonstration of VB6-SVG is included in this repository.  It is extensively commented, but if you would like a brief overview of how to use this code in your own VB6 project, keep reading.\r\n\r\nVB6-SVG has three mandatory components.  All three must be added to your VB6 project:\r\n\r\n1. `resvg.dll`\r\n2. `svgSupport.bas`\r\n3. `svgImage.cls`\r\n\r\n`svgSupport` handles resvg initialization, shutdown, and a bunch of associated resource management and GDI interop.\r\n\r\n`svgImage` is a lightweight convenience class for managing individual SVG image instances.  Create instances of this class by calling `svgSupport.LoadSVG_FromFile()`.\r\n\r\nAdding SVG support to your own VB6 projects is simple:\r\n\r\n1. Ensure you have read and understood both `LICENSE.md` (for the VB6 code) and `resvg-LICENSE.md` (for resvg).\r\n2. Ship `resvg.dll` with your app.  This is a traditional DLL, not an ActiveX dll, so you do not need to register it.  Just make sure it is available in a predictable location.\r\n3. Somewhere in your VB6 project initialization, add one line of code:\r\n\r\n`svgSupport.StartSVGSupport \"C:\\[path-to-resvg-folder]\\resvg.dll\"`\r\n\r\nThat line of code will initialize resvg and prepare a bunch of SVG-related resources.\r\n\r\n4. Create (unlimited) `svgImage` instances by calling:\r\n\r\n`svgSupport.LoadSVG_FromFile([path-to-svg] As String, [dstSvgImage] As svgImage)`\r\n\r\nEach `svgImage` instance manages a single SVG image.  `svgImage` stores a parsed SVG \"tree\", allowing you to render the SVG over-and-over at whatever position(s), size(s), and opacities you desire.  You can query individual instances for their default width/height, or draw them at whatever width/height you want using the `DrawSVGtoDC()` function.  As you'd expect for vector images, resizing and painting is always non-destructive.\r\n\r\n5. `svgImage` instances manage their own resources.  You do not need to manage them manually, with one exception (see (6), below).\r\n\r\n6. Before your program exits, ensure all `svgImage` instances have gone out of scope (or been manually freed), then add one line of code to your program shutdown process:\r\n\r\n`svgSupport.StopSVGSupport`\r\n\r\nThis will free all shared GDI and SVG resources used by the project, then manually unload resvg itself.  \r\n\r\nAs you can imagine, if you are using module- or global- (*ugh*) `svgImage` class instances, they need to be freed **before** calling `StopSVGSupport`, because once resvg is released, SVG management is over.\r\n\r\n7. *(Optional)* some manual processing is required to allow painting SVGs to arbitrary Windows DCs.  Performance is significantly improved when compiled to native code with the `Remove Array Bounds Checks` optimization enabled.  Please do this.\r\n\r\n8. That's it!  If you encounter any bugs or unexpected behavior, please [file an issue at GitHub](https://github.com/tannerhelland/vb6-svg/issues).\r\n\r\n### Licensing\r\n\r\nThe VB6 portion of this project is available under a Simplified BSD license.  Full details are provided in [LICENSE.md](https://github.com/tannerhelland/vb6-svg/blob/main/LICENSE.md).\r\n\r\nresvg is available under an MPL-2 license.  Full details are provided in [resvg-LICENSE.md](https://github.com/tannerhelland/vb6-svg/blob/main/resvg-LICENSE.md).\r\n\r\nMany thanks to [Yevhenii Reizner](https://github.com/RazrFalcon) for his work on resvg.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftannerhelland%2Fvb6-svg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftannerhelland%2Fvb6-svg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftannerhelland%2Fvb6-svg/lists"}