ml_imageloader.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef NULLSOFT_MEIDALIBRARY_IMAGE_SOURCE_HEADER
  2. #define NULLSOFT_MEIDALIBRARY_IMAGE_SOURCE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <windows.h>
  7. typedef struct _MLIMAGESOURCE_I
  8. {
  9. HINSTANCE hInst; //
  10. LPCWSTR lpszName; //
  11. UINT bpp; //
  12. INT xSrc; //
  13. INT ySrc; //
  14. INT cxSrc; //
  15. INT cySrc; //
  16. INT cxDst; //
  17. INT cyDst; //
  18. UINT type; //
  19. UINT flags; //
  20. } MLIMAGESOURCE_I;
  21. // Image Source types:
  22. #define SRC_TYPE_BMP_I 0x01 // hInst = depends on ISF_LOADFROMFILE, lpszName = resource (file) name. To make resource name from resource id use MAKEINTERESOURCEW().
  23. #define SRC_TYPE_PNG_I 0x02 // hInst = depends on ISF_LOADFROMFILE, lpszName = resource (file) name. To make resource name from resource id use MAKEINTERESOURCEW().
  24. #define SRC_TYPE_HBITMAP_I 0x03 // hInst = NULL, lpszName =(HBITMAP)hbmp.
  25. #define SRC_TYPE_HIMAGELIST_I 0x04 // hInst = (HIMAGELIST)himl, lpszName = MAKEINTERESOURCEW(index). Make Sure that common controls initialized before using this.
  26. // Image Source flags:
  27. #define ISF_LOADFROMFILE_I 0x0001 // Load image from file. hInst ignored.
  28. #define ISF_USE_OFFSET_I 0x0002 // xSrc and ySrc valid.
  29. #define ISF_USE_SIZE_I 0x0004 // cxSrc and cySrc valid.
  30. #define ISF_FORCE_BPP_I 0x0010 //
  31. #define ISF_FORCE_SIZE_I 0x0020 //
  32. #define ISF_SCALE_I 0x0040 //
  33. #define ISF_PREMULTIPLY_I 0x0100 // supported only by png
  34. #define ISF_NOLOCALIZED_LOAD_I 0x0200 // when loading res:// protocol do not try to load resource from localized resource first
  35. HBITMAP MLImageLoaderI_LoadDib(const MLIMAGESOURCE_I *pImgSource);
  36. BOOL MLImageLoaderI_CopyData(MLIMAGESOURCE_I *pisDst, const MLIMAGESOURCE_I *pisSrc); /// Creates copy of MLIMAGESOURCE.
  37. BOOL MLImageLoaderI_FreeData(MLIMAGESOURCE_I *pisDst); /// use it to properly free MLIMAGESOURCE that was set using MLImageLoader_CopyData
  38. BOOL MLImageLoaderI_CheckExist(const MLIMAGESOURCE_I *pis);
  39. #endif //NULLSOFT_MEIDALIBRARY_IMAGE_SOURCE_HEADER