我试图加载位图以便在屏幕上呈现它,这样做我使用 loadSurfaceFromFile。我要加载的图像是 1280*1024,加载这些图像大约需要 35 毫秒。在我看来,它应该加载得更快(大约 5 毫秒)我做错了什么?
编辑代码:
QueryPerformanceCounter(&liStart2);
int size = load_file_to_memory(s.c_str(),&content);
QueryPerformanceCounter(&liStop2);
QueryPerformanceCounter(&liStart);
D3DXLoadSurfaceFromFileInMemory(surface,NULL,NULL,content,size,NULL,D3DX_DEFAULT,0,NULL);
QueryPerformanceCounter(&liStop);
LONGLONG llTimeDiff = liStop.QuadPart - liStart.QuadPart;
double dftDuration = (double) llTimeDiff * 1000.0 / (double) Frequency.QuadPart;
LONGLONG llTimeDiff2 = liStop2.QuadPart - liStart2.QuadPart;
double dftDuration2 = (double) llTimeDiff2 * 1000.0 / (double) Frequency.QuadPart;