﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Wxt's Blog-随笔分类-Win32</title><link>http://www.cppblog.com/wxtnote/category/21134.html</link><description>专注于 GUI 程序设计</description><language>zh-cn</language><lastBuildDate>Wed, 12 Aug 2015 06:45:17 GMT</lastBuildDate><pubDate>Wed, 12 Aug 2015 06:45:17 GMT</pubDate><ttl>60</ttl><item><title>Gdiplus的初始化辅助类</title><link>http://www.cppblog.com/wxtnote/archive/2015/03/19/210101.html</link><dc:creator>wxt</dc:creator><author>wxt</author><pubDate>Thu, 19 Mar 2015 07:14:00 GMT</pubDate><guid>http://www.cppblog.com/wxtnote/archive/2015/03/19/210101.html</guid><wfw:comment>http://www.cppblog.com/wxtnote/comments/210101.html</wfw:comment><comments>http://www.cppblog.com/wxtnote/archive/2015/03/19/210101.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wxtnote/comments/commentRss/210101.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wxtnote/services/trackbacks/210101.html</trackback:ping><description><![CDATA[在使用Gdiplus的功能之前，要先进行初始化，对应的函数是Gdiplus::GdiplusStartup，在使用完Gdiplus的功能之后，要进行反初始化，对应的函数则是Gdiplus::GdiplusShutdown。<br />为了简化编程，这里实现了一个简单的Gdiplus初始化类，作为全局对象使用，类似于MFC的theApp对象。代码如下：<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->#pragma&nbsp;once<br /><br />#include&nbsp;&lt;GdiPlus.h&gt;<br /><br /><span style="color: #0000FF; ">class</span>&nbsp;GdiPlusHelper<br />{<br /><span style="color: #0000FF; ">public</span>:<br />&nbsp;&nbsp;&nbsp;&nbsp;GdiPlusHelper()<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gdiplus::GdiplusStartupInput&nbsp;gdiplusStartupInput;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gdiplus::GdiplusStartup(&amp;m_nGdiPlusToken,&nbsp;&amp;gdiplusStartupInput,&nbsp;NULL);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;~GdiPlusHelper()<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gdiplus::GdiplusShutdown(m_nGdiPlusToken);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;ULONG_PTR&nbsp;m_nGdiPlusToken;<br />};</div><img src ="http://www.cppblog.com/wxtnote/aggbug/210101.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wxtnote/" target="_blank">wxt</a> 2015-03-19 15:14 <a href="http://www.cppblog.com/wxtnote/archive/2015/03/19/210101.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>