Some improvements for a loading of icons

This commit is contained in:
YuSanka 2019-04-05 11:18:13 +02:00
parent a9223aeb5f
commit ef5281c3c9
5 changed files with 40 additions and 20 deletions

View file

@ -31,10 +31,10 @@ public:
wxBitmap* insert(const std::string &name, const wxBitmap *begin, const wxBitmap *end);
wxBitmap* insert_raw_rgba(const std::string &bitmap_key, unsigned int width, unsigned int height, const unsigned char *raw_data);
// Load png from resources/icons. bitmap_key is given without the .png suffix. Bitmap will be rescaled to provided height if nonzero.
wxBitmap* load_png(const std::string &bitmap_key, unsigned int height = 0);
// Load svg from resources/icons. bitmap_key is given without the .svg suffix. SVG will be rasterized to provided height.
wxBitmap* load_svg(const std::string &bitmap_key, unsigned int height);
// Load png from resources/icons. bitmap_key is given without the .png suffix. Bitmap will be rescaled to provided height/width if nonzero.
wxBitmap* load_png(const std::string &bitmap_key, unsigned int width = 0, unsigned int height = 0);
// Load svg from resources/icons. bitmap_key is given without the .svg suffix. SVG will be rasterized to provided height/width.
wxBitmap* load_svg(const std::string &bitmap_key, unsigned int width = 0, unsigned int height = 0);
static wxBitmap mksolid(size_t width, size_t height, unsigned char r, unsigned char g, unsigned char b, unsigned char transparency);
static wxBitmap mksolid(size_t width, size_t height, const unsigned char rgb[3]) { return mksolid(width, height, rgb[0], rgb[1], rgb[2], wxALPHA_OPAQUE); }