BsIconUtility.h 1.1 KB

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