我正在尝试在 FreeImage 中加载一个.png
和一个.DDS
文件,但宽度和高度始终为零。
#include <stdio.h>
#include<stdlib.h>
#include <FreeImage.h>
int main(void){
const char* path = "Signal.png";
printf("Loading image %s\n", path);
FIBITMAP* image = FreeImage_Load(FreeImage_GetFileType(path), path, 0);
unsigned int w = FreeImage_GetWidth(image);
unsigned int h = FreeImage_GetHeight(image);
printf("Width: %u Height: %u\n", w, h);
}
输出:
Loading image Signal.png
Width: 0 Height: 0