如题,谢谢

解决方案 »

  1.   

    #define UNICODE
    #include <windows.h>
    #include <gdiplus.h>
    using namespace Gdiplus;VOID OnPaint(HDC hdc)
    {
       Graphics graphics(hdc);
       Pen      pen(Color(255, 0, 0, 255));
       graphics.DrawLine(&pen, 0, 0, 200, 100);
    }LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, INT iCmdShow)
    {
       HWND                hWnd;
       MSG                 msg;
       WNDCLASS            wndClass;
       GdiplusStartupInput gdiplusStartupInput;
       ULONG_PTR           gdiplusToken;
       
       // Initialize GDI+.
       GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
       
       wndClass.style          = CS_HREDRAW | CS_VREDRAW;
       wndClass.lpfnWndProc    = WndProc;
       wndClass.cbClsExtra     = 0;
       wndClass.cbWndExtra     = 0;
       wndClass.hInstance      = hInstance;
       wndClass.hIcon          = LoadIcon(NULL, IDI_APPLICATION);
       wndClass.hCursor        = LoadCursor(NULL, IDC_ARROW);
       wndClass.hbrBackground  = (HBRUSH)GetStockObject(WHITE_BRUSH);
       wndClass.lpszMenuName   = NULL;
       wndClass.lpszClassName  = TEXT("GettingStarted");
       
       RegisterClass(&wndClass);
       
       hWnd = CreateWindow(
          TEXT("GettingStarted"),   // window class name
          TEXT("Getting Started"),  // window caption
          WS_OVERLAPPEDWINDOW,      // window style
          CW_USEDEFAULT,            // initial x position
          CW_USEDEFAULT,            // initial y position
          CW_USEDEFAULT,            // initial x size
          CW_USEDEFAULT,            // initial y size
          NULL,                     // parent window handle
          NULL,                     // window menu handle
          hInstance,                // program instance handle
          NULL);                    // creation parameters
      
       ShowWindow(hWnd, iCmdShow);
       UpdateWindow(hWnd);
       
       while(GetMessage(&msg, NULL, 0, 0))
       {
          TranslateMessage(&msg);
          DispatchMessage(&msg);
       }
       
       GdiplusShutdown(gdiplusToken);
       return msg.wParam;
    }  // WinMainLRESULT CALLBACK WndProc(HWND hWnd, UINT message, 
       WPARAM wParam, LPARAM lParam)
    {
       HDC          hdc;
       PAINTSTRUCT  ps;
       
       switch(message)
       {
       case WM_PAINT:
          hdc = BeginPaint(hWnd, &ps);
          OnPaint(hdc);
          EndPaint(hWnd, &ps);
          return 0;
       case WM_DESTROY:
          PostQuitMessage(0);
          return 0;
       default:
          return DefWindowProc(hWnd, message, wParam, lParam);
       }
    } // WndProc然后下载 platform SDK,Runtime GDI+,设置include lib路径,link  gdiplus.lib
      

  2.   

    先安装了platform 其中包含gdi+将include和lib目录的路径添加到options中。并将他们都移到最前面,比较优先。在需要使用的地方#include <gdiplus.h>和#progma comment(lib,"gdiplus.lib")就可以使用了
      

  3.   

    先安装了platform 其中包含gdi+将include和lib目录的路径添加到options中。并将他们都移到最前面,比较优先。在需要使用的地方#include <gdiplus.h>和#progma comment(lib,"gdiplus.lib")就可以使用了
      

  4.   

    别忘了,如果没有下载Runtime GDI+的话,没有gdiplus.dll,是无法运行的!
      

  5.   

    谁能谈谈GDI+的好处(和GDI比有什么强大的功能?)
    最好有具体的实例?
      

  6.   

    新版的gdi+ 1.1已经提供了简单的图像处理功能,包括亮度,对比度,色饱和度,gamma调整
    还有红眼校正,高斯模糊,色平衡,锐化,着色等功能。但是还没有提供下载
    至于旧版的,自己看msdn吧,所有例子代码都有的http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdicpp/GDIPlus/GDIPlusReference/Classes/
      

  7.   

    老弟英语够可以的,呵呵呵
    http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=BFC0B436-9015-43E2-81A3-54938B6F4614