Support creating wxBitmapBundle from SVG in application resource

Allow creating wxBitmapBitmap from SVG image stored in an application
resource on the platforms where wxHAS_IMAGE_RESOURCES is defined.

On Windows, load the bundle from a resource with RT_RCDATA type and on
MacOS from a file with an extension "svg" placed in the "Resources"
subdirectory of the application bundle.

Closes #22061.
This commit is contained in:
PB 2022-01-26 16:58:49 +01:00 committed by Vadim Zeitlin
parent 3f3561e2c6
commit 5ba37d867c
5 changed files with 80 additions and 3 deletions

View file

@ -78,6 +78,12 @@ public:
// Load SVG image from the given file (must be a local file, not an URL).
static wxBitmapBundle FromSVGFile(const wxString& path, const wxSize& sizeDef);
// Create from SVG image stored as an application resource.
// On Windows, name must be a resource with RT_RCDATA type.
// On MacOS, name must be a file with an extension "svg" placed in the
// "Resources" subdirectory of the application bundle.
static wxBitmapBundle FromSVGResource(const wxString& name, const wxSize& sizeDef);
#endif // wxHAS_SVG
// Create from the resources: all existing versions of the bitmap of the