BsIconUtility.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include "BsCorePrerequisites.h"
  3. namespace BansheeEngine
  4. {
  5. /**
  6. * @brief Manipulates icons in executable files.
  7. */
  8. class BS_CORE_EXPORT IconUtility
  9. {
  10. public:
  11. /**
  12. * @brief Updates icons in the provided executable. Only icons that already exist in the executable can be
  13. * updated, no new icons can be inserted. Icons must be square.
  14. *
  15. * @param filePath Path to the executable.
  16. * @param icons Pixels of images to replace. Each entry maps an icon width (and height, since
  17. * they're square) to its pixels.
  18. */
  19. static void updateIconExe(const Path& filePath, const Map<UINT32, PixelDataPtr>& icons);
  20. private:
  21. /**
  22. * @brief Updates data of an existing icon with new pixels.
  23. *
  24. * @param iconData Existing icon bytes, in Windows ICO format.
  25. * @param icons Pixels of images to replace. Each entry maps an icon width (and height, since
  26. * they're square) to its pixels.
  27. */
  28. static void updateIconData(UINT8* iconData, const Map<UINT32, PixelDataPtr>& icons);
  29. };
  30. }