GCC使用GDI+ (转贴参考)
来源:互联网 发布:淘宝20万关键词 编辑:程序博客网 时间:2024/06/08 04:01
Mingw-users] Successful compile of simple GDI+ program using modified headers· Date: Fri, 15 Jul 2005 11:35:17 +0800· From: Andy Sy · Subject: [Mingw-users] Successful compile of simple GDI+ program using modified headersProviding these steps for comment and further testing by others1) First download the following GDIplus headers http://www.codeguru.com/code/legacy/gdi/GDIPlus.zip*** These may have come from the Platform SDK.2) Then make the following mods:i. In GdiPlusEnums.h: Comment out enum EmfPlusRecordType; and change #define GDIP_WMF_RECORD_TO_EMFPLUS(n) ((EmfPlusRecordType)((n) | GDIP_WMF_RECORD_BASE)) to #define GDIP_WMF_RECORD_TO_EMFPLUS(n) ((n) | GDIP_WMF_RECORD_BASE) *** This looks like a harmless changeii. In GdiPlusImaging.h Change PixelFormat PixelFormat; to PixelFormat PixelFormat1; *** I'm almost certain this will break stuff, but at least it will let you compile successfully. A better solution needs to be discovered.iii. In GdiPlusimageAttributes.h Change return SetStatus(DllExports::GdipSetImageAttributesColorKeys( nativeImageAttr,type,FALSE,NULL,NULL)); to return SetStatus(DllExports::GdipSetImageAttributesColorKeys( nativeImageAttr,type,FALSE,0,0)); *** This just eliminates your pesky pointer to int conversion warning, so I believe this is a benign modificationiv. In GdiPlusHeaders.h Change friend Graphics; to friend class Graphics; *** This also looks like a benign modification, is it?3) Create libgdiplus.a using 'reimp' from mingw-utils Get the gdiplus.dll under /windows/WinSxS/... and do: reimp gdiplus.dll That's it!The linedraw.cpp GDI plus sample program compiles successfully using: gcc -IincludeXXX -LlibXXX linedraw.cpp -lstdc++ -lgdiplus -mwindowswhere includeXXX and libXXX points to the include directory where thegdiplus headers and libgdiplus.a reside respectively.More feedback on success or failure compiling more complex gdiplusprograms needed.-------------------------------------------------------SF.Net email is sponsored by: Discover Easy Linux Migration Strategiesfrom IBM. Find simple to follow Roadmaps, straightforward articles,informative Webcasts and more! Get everything you need to get up tospeed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click_______________________________________________MinGW-users mailing listMinGW-users@xxxxxxxxxxxxxxxxxxxxxYou may change your MinGW Account Options or unsubscribe at:https://lists.sourceforge.net/lists/listinfo/mingw-users2008-01-15:怎用由GdiPlus.lib生成g++可用的libGdiPlus.a?以下是我做成功的一个步骤:假设devcpp安装于C:/Dev-Cpp下载mingw-utils假设mingw-utils目录存放于C:/Dev-Cpp/mingw-utils-0.3.tar/bin假设GdiPlus.lib存放于F:/GdiPlus/testpath C:/Dev-Cpp/bin;C:/Dev-Cpp/mingw-utils-0.3.tar/bin;%path%f:cd F:/GdiPlus/testreimp gdiplus.lib此时生成 0, gdiplus.def, libgdiplus.a 三个文件然后修改GdiplusEnums.h等1. In GdiPlusEnums.h: enum EmfPlusRecordType; 改为 //enum EmfPlusRecordType; #define GDIP_WMF_RECORD_TO_EMFPLUS(n) ((EmfPlusRecordType)((n) | GDIP_WMF_RECORD_BASE)) 改为 #define GDIP_WMF_RECORD_TO_EMFPLUS(n) (/*(EmfPlusRecordType)*/((n) | GDIP_WMF_RECORD_BASE))2. In GdiPlusImaging.h PixelFormat PixelFormat; 改为 PixelFormat aPixelFormat;3. In GdiPlusimageAttributes.h return SetStatus(DllExports::GdipSetImageAttributesColorKeys(nativeImageAttr,type,FALSE,NULL,NULL)); 改为 return SetStatus(DllExports::GdipSetImageAttributesColorKeys(nativeImageAttr,type,FALSE,0,0));4. In GdiPlusHeaders.h friend Graphics; 改为 friend class Graphics;最后将一开始的代码中的中文字符删除,并加入libGdiPlus.a库,运行通过。
- GCC使用GDI+ (转贴参考)
- 【转】GDI使用经验分享
- 【转】在GDI+使用区域
- 使用 GDI+
- 使用GDI+
- GDI+ 使用
- 使用GDI+
- 使用GDI
- gdi使用
- GCC技术参考大全
- 在VC 中使用GDI+[转]
- GCC命令-详细请参考GCC手册
- GCC技术参考重点解析
- g++/gcc编译使用方法参考
- copy, 仅供自己参考: arm-linux-gcc ELDK使用 cross compiler
- UrlRewrite 使用参考文档(转)
- [转]hg(Mercurial)使用参考
- gcc使用的方法【转】
- 九十后女生眼中的事业与爱情
- 测试1秒钟休眠所耗费的时间
- Windows下条件变量的实现
- TUE MAR 31,2009
- 看解放军训练就是一场噩梦
- GCC使用GDI+ (转贴参考)
- qeephp生成静态html的方法
- 一名北理工学子的心路历程
- SQL操作大全
- 好的网站
- 一个团队的良好气氛应该怎么营造
- 又开始流行“敏捷”了
- SQL Server 2000的企业管理器里找不到数据库服务器
- 新技术总监入职感受总结