2013年5月10日
摘要: 如题,我也不知道为什么,测试代码:1usingnamespaceGdiplus;23wstringstrLine=L"1个你好啊2个你好啊3个你好啊4个你好啊5个你好啊6个你好啊7个你好啊8个你好啊";4constintwordCount=strLine.size();56CPaintDCpaintDc(this);7Graphicsg(paintDc.GetSafeHdc());8Gdiplus::Fontmyfont(L"宋体",16,Gdiplus::FontStyleBold);910constintregion_count=wordCount+ 阅读全文
posted @ 2013-05-10 17:11 sanlo 阅读(1914) 评论(0) 推荐(0) 编辑
摘要: 注:如果包含 后出现编译错误,那么看看stdafx.h中有没有定义WIN32_LEAN_AND_MEAN,有的话注释掉就OK1. 需要链接gdiplus.lib2.使用GDI+需要进行初始化,否则运行时会出现问题。为了方便使用,我将初始化代码和释放代码放到一个类中,使用时只需要定义这个类的一个global实例就可以了1classGdiPlusIniter{2public:3GdiPlusIniter(){4Gdiplus::GdiplusStartupInputStartupInput;5GdiplusStartup(&m_gdiplusToken,&StartupInput, 阅读全文
posted @ 2013-05-10 16:51 sanlo 阅读(3287) 评论(0) 推荐(0) 编辑