using namespace Gdiplus;

来源:互联网 发布:js折线图插件 编辑:程序博客网 时间:2024/06/06 01:46
#include <GDIplus.h>using namespace Gdiplus;#pragma comment(lib,"GdiPlus.lib")////////////////////////////////////////class CGDIplus2App : public CWinApp{public:ULONG_PTR m_gdiplusToken;////////////////////////////////////{Gdiplus::GdiplusStartupInput gdiplusStartupInput;Gdiplus::GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL);}int nResponse = dlg.DoModal();{Gdiplus::GdiplusShutdown(m_gdiplusToken);}////////////////////////////////////void CGDIplus2Dlg::OnDrawLine() {HDC          hdc;//PAINTSTRUCT  ps;Pen*         myPen;Graphics*    myGraphics;HWND hWnd=this->m_hWnd;//hdc = ::BeginPaint(hWnd, &ps);hdc = ::GetDC(hWnd);   myPen = new Pen(Color(255, 255, 0, 0), 3);   myGraphics = new Graphics(hdc);   myGraphics->DrawLine(myPen, 20, 10, 400, 200);   delete myGraphics;   delete myPen;//::EndPaint(hWnd, &ps);::ReleaseDC(hWnd,hdc);}