22 return any_cast<HICON>(
images.at(pathToIcon).data);
27 const any* result =
nullptr;
29 for (
const auto& [path, data] :
images)
31 if (data.index == iconIndex)
39 throw out_of_range(
"Wrong index");
42 return any_cast<HICON>(*result);
Base class for all visual asset loaders.
virtual uint16_t insertImage(const std::filesystem::path &pathToImage, imageType type) final
std::unordered_map< std::wstring, imageData > images
uint16_t addImage(const std::filesystem::path &pathToIcon) override
IconsHolder(uint16_t imagesWidth, uint16_t imagesHeight, size_t count=standard_sizes::defaultImagesCount)
HICON getIcon(const std::filesystem::path &pathToIcon) const