Home > Software engineering >  GDI OutOfMemory for the image (3) the problem?
GDI OutOfMemory for the image (3) the problem?

Time:09-25


//GDI#include  
#include
Using the namespace Gdiplus;
# pragma comment (lib, "gdiplus. Lib")

ULONG_PTR m_gdiplusToken;//as a global variable declaration;

//initialize GDI +
Gdiplus: : GdiplusStartupInput GdiplusStartupInput;
Gdiplus: : GdiplusStartup (& amp; M_gdiplusToken, & amp; GdiplusStartupInput, NULL);

//load the picture
Gdiplus: : Image Image (L "E: \ \ MyItem \ \ JsCppCSharp \ \ DuiLib_Ultimate master_New \ \ DuiLib_Ultimate - master \ \ bin \ skin \ \ duidemo \ \ the main \ \ 5. JPG");


Using the absolute path for the image, Vs2013 compiled through, in his notebook (doing) test is feasible, Windows 7 desktops images load error OutOfMemory (3)

CodePudding user response:

Vs2013 compiled through, in his notebook (doing) test is feasible under such a scenario run right??????
Windows 7 on a desktop picture load error this is not correct
If the code for the response of the system version set macros

CodePudding user response:

The compiled program with macro it doesn't matter, should be your Windows 7 don't have the catalog file to load error

CodePudding user response:

Estimated with the upstairs said, not the catalog file
PS: don't write the code path so dead, would write a relative path to better test,

CodePudding user response:

Use CFileDialog select file or the GetModuleFileName constructs the absolute path
  • Related