用GDI+转换图形格式.rar

  • PUDN用户
    了解作者
  • Visual C++
    开发工具
  • 4KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 28
    下载次数
  • 2005-09-20 15:20
    上传日期
用GDI+转换图形格式,需要下载相应的GDI+库等,建议将VC SDK升级到最新 升级地址: http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
用GDI+转换图形格式.rar
  • 用GDI+转换图形格式.doc
    26.5KB
  • www.pudn.com.txt
    218B
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/622b3011ff7f9c46a691df86/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/622b3011ff7f9c46a691df86/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">//<span class="ff2 sc1">&#29992;<span class="_ _0"> </span></span>GDI+<span class="ff2 sc1">&#36716;&#25442;&#22270;&#24418;&#26684;&#24335;</span></div><div class="t m0 x1 h4 y3 ff3 fs1 fc1 sc0 ls0 ws0">#include&#58889;"afxdtctl.h"</div><div class="t m0 x1 h4 y4 ff3 fs1 fc1 sc0 ls0 ws0">#ifndef&#58889;ULONG_PTR</div><div class="t m0 x1 h4 y5 ff3 fs1 fc1 sc0 ls0 ws0">#de&#58906;ne&#58889;ULONG_PTR&#58889;unsigned&#58889;long*</div><div class="t m0 x1 h4 y6 ff3 fs1 fc1 sc0 ls0 ws0">#include&#58889;"GdiPlus.h"</div><div class="t m0 x1 h4 y7 ff3 fs1 fc1 sc0 ls0 ws0">using&#58889;namespace&#58889;Gdiplus;</div><div class="t m0 x1 h4 y8 ff3 fs1 fc1 sc0 ls0 ws0">#pragma&#58889;comment(lib,&#58889;"gdiplus.lib")</div><div class="t m0 x1 h4 y9 ff3 fs1 fc1 sc0 ls0 ws0">#endif</div><div class="t m0 x1 h4 ya ff3 fs1 fc1 sc0 ls0 ws0">INT&#58889;GetEncoderClsid(const&#58889;WCHAR*&#58889;format,&#58889;CLSID*<span class="_ _1"></span>&#58889;pClsid);&#58889;&#58889;//&#58889;helper&#58889;function</div><div class="t m0 x1 h4 yb ff3 fs1 fc1 sc0 ls0 ws0">INT&#58889;main()</div><div class="t m0 x1 h4 yc ff3 fs1 fc1 sc0 ls0 ws0">{</div><div class="t m0 x1 h4 yd ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;//&#58889;Initialize&#58889;GDI+.</div><div class="t m0 x1 h4 ye ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;GdiplusStartupInput&#58889;gdiplusStartupInput;</div><div class="t m0 x1 h4 yf ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;ULONG_PTR&#58889;gdiplusToken;</div><div class="t m0 x1 h4 y10 ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;GdiplusStartup(&amp;gdiplusToken,&#58889;&amp;gdiplusStartupInput,&#58889;NULL);</div><div class="t m0 x1 h4 y11 ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;CLSID&#58889;&#58889;&#58889;encoderClsid;</div><div class="t m0 x1 h4 y12 ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;Status&#58889;&#58889;stat;</div><div class="t m0 x1 h5 y13 ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;//Image*&#58889;&#58889;&#58889;image&#58889;=&#58889;new&#58889;Image(L"C:\Test.jpg");&#58889;//<span class="ff2">&#36825;&#21477;&#22312;&#58891;</span>MFC<span class="_ _2"> </span><span class="ff2">&#19979;&#25253;&#38169;</span></div><div class="t m0 x1 h4 y14 ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;Image*&#58889;&#58889;&#58889;image&#58889;=&#58889;NULL;</div><div class="t m0 x1 h4 y15 ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;image&#58889;=&#58889;Bitmap::FromFile(L"C:\Test.jpg",&#58889;TRUE);</div><div class="t m0 x1 h4 y16 ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;</div><div class="t m0 x1 h4 y17 ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;//&#58889;Get&#58889;the&#58889;CLSID&#58889;of&#58889;the&#58889;PNG&#58889;encoder.</div><div class="t m0 x1 h4 y18 ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;GetEncoderClsid(L"image/bmp",&#58889;&amp;encoderClsid);</div><div class="t m0 x1 h4 y19 ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;stat&#58889;=&#58889;image-&gt;Save(L"C:\Test.bmp",&#58889;&amp;encoderClsid,<span class="_ _1"></span>&#58889;NULL);</div><div class="t m0 x1 h4 y1a ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;if(stat&#58889;==&#58889;Ok)</div><div class="t m0 x1 h4 y1b ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;&#58889;&#58889;&#58889;printf("Bird.png&#58889;was&#58889;saved&#58889;successfully ");</div><div class="t m0 x1 h4 y1c ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;else</div><div class="t m0 x1 h4 y1d ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;&#58889;&#58889;&#58889;printf("Failure:&#58889;stat&#58889;=&#58889;%d ",&#58889;stat);&#58889;</div><div class="t m0 x1 h4 y1e ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;delete&#58889;image;</div><div class="t m0 x1 h4 y1f ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;GdiplusShutdown(gdiplusToken);</div><div class="t m0 x1 h4 y20 ff3 fs1 fc1 sc0 ls0 ws0">&#58889;&#58889;&#58889;return&#58889;0;</div><div class="t m0 x1 h4 y21 ff3 fs1 fc1 sc0 ls0 ws0">}</div><div class="t m0 x1 h4 y22 ff3 fs1 fc1 sc0 ls0 ws0">INT&#58889;GetEncoderClsid(const&#58889;WCHAR*&#58889;format,&#58889;CLSID*<span class="_ _1"></span>&#58889;pClsid)</div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐
    • VC GDI+编程实现 桌面挂件 时钟
      GDI+基本编程,实现一个透明的挂件时钟。参考了VCkbase网站的资源http://www.vckbase.com/document/viewdoc/?id=1745
    • vc mtc GDI+ 双缓存画图板
      vc mtc GDI+ 双缓存vc mtc GDI+ 双缓存vc6.0编译通过
    • GDI+ GDIPlus
      一般在vc6.0下用GDI+开发的类库,GDI+为GDI的下一个版本,一般.net版本包含了该类库。
    • gdi+绘图例子
      gdi+中画笔,画刷,文本与字体,路径和区域,坐标变换,色彩变换,图像处理等实例(效果+源码)
    • VC++_GDI+编程 VC++_GDI+编程 VC++_GDI+编程
      VC++_GDI+编程 VC++_GDI+编程 VC++_GDI+编程
    • GDI+开发包
      VC++6下面的GDI编程太麻烦了,没有和硬件彻底分离,好多句柄,头晕。现在可以将GDI+用在VC6下面了,大大方便了图像编程。
    • GDI+开发包 GDI+安装详解
      VC6.0 中添加库文件在:工具-> 选项-> 目录 ,添加lib和include GDI+所在路径,并把他们置前 在VC.net中添加库文件在:项目菜单->属性->链接器->输入 举个例子: (1)在应用程序项目的应用类中,添加一个成员...
    • GDI+VC配置工具
      下载(GDI+ for VC6.0 SDK)GDIPlus文件将其中的Includes和Lib中的文件拷到vc目录下的Includes和Lib文件夹中. 下载地址:http://www.codeguru.com/code/legacy/gdi/GDIPlus.zip(引用他人的) 2.在你将要使用GDI+的...
    • VC6使用GDI+示例
      软件平台: WinXP + VC++ 6.0 + GDI+ ---------------------------------------------------------------- 使用方法: 1. 将GdiPlus.rar中的Includes和Lib中的文件拷到项目下; 2. 添加项目的包含路径 GdiPlus\...
    • GDI+文件及使用方法
      1.将GDI+.rar将其中的Includes和Lib中的文件拷到vc目录下的 Includes和Lib文件夹中,gdiplus.dll保存在windows/system32中; GDI+ for VC6.0 SDK下载地址: http://www.codeguru.com/code/legacy/gdi/GDIPlus.zip 2....