fi.cpp 395 B

12345678910111213141516171819
  1. #include <stdio.h>
  2. #include "FreeImage.h"
  3. int main() {
  4. #if defined(FREEIMAGE_LIB) || !defined(WIN32)
  5. FreeImage_Initialise(FALSE);
  6. #endif
  7. FIBITMAP* dib = FreeImage_Load(FIF_PNG, "img.png", PNG_DEFAULT);
  8. printf("%dx%d", FreeImage_GetWidth(dib), FreeImage_GetHeight(dib));
  9. FreeImage_Unload(dib);
  10. #if defined(FREEIMAGE_LIB) || !defined(WIN32)
  11. FreeImage_DeInitialise();
  12. #endif
  13. return 0;
  14. }