BsIconUtility.h 1.3 KB

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