I am trying to load a picture (.bmp or .jpg) with this code:
HDC hdc = GetDC(NULL);
Gdiplus::Bitmap* image = Gdiplus::Bitmap::FromFile(fileName, false);
if (image == NULL) {
std::cout << "Picture not found" << std::endl;
return false;
}
I always get "Picture not found". I 've tried the following:
TCHAR* fileName = L"background.bmp";
TCHAR* fileName = L"C:\\background.bmp";
The picture is on C: and in the project folder. Where should I save the image, so that it can be found? Or am I doing something essential wrong or am I missing something? I am using Visual Studio2013 and a Win32 console application (native C++). Thank you for your help