非托管代码能不能使用gdi+

解决方案 »

  1.   

    可以使用GDI+#include <windows.h>
    #include <gdiplus.h>
    #include <stdio.h>
    using namespace Gdiplus;
    #pragma comment(lib, "gdiplus.lib")INT main()
    {
       GdiplusStartupInput gdiplusStartupInput;
       ULONG_PTR gdiplusToken;
       GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);   Image* image = new Image(L"FakePhoto.jpg");
       printf("The width of the image is %u.\n", image->GetWidth());
       printf("The height of the image is %u.\n", image->GetHeight());    delete image;
       GdiplusShutdown(gdiplusToken);
       return 0;
    }