1.通过文件路径加载本地图片:
a. FS_DIBitmap bitmap = FRWindowsDIBLoadFromFile(L”D:/Test.png”);
b. FS_DIBitmap bitmap =FSDIBitmapLoadFromPNGIcon(L”D:/Test.png”);
2.通过资源ID加载图片(例如资源ID是IDB_PNG_LARGE):
AFX_MANAGE_STATE(AfxGetStaticModuleState());// 确保MFC模块状态正确
FS_DIBitmap bitmap= FSDIBitmapLoadFromPNGIcon3(AfxGetInstanceHandle(), (FS_LPCWSTR)MAKEINTRESOURCE(IDB_PNG_LARGE));