BsIconUtility.h 1.4 KB

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