百度空间 | 百度首页 
 
查看文章
 
vista icon 和xp下的icon的转换 replacevistaicon
2009年06月05日 星期五 03:59 P.M.

Introduction

This article describes the basic differences between Windows XP and Windows Vista icons and explains how to use Vista icons in your applications.

Vista Icons


(continued)
&amp;lt;script language="JavaScript" type="text/javascript"&amp;gt; document.write('&amp;lt;a href="http://mjxads.internet.com/RealMedia/ads/click_lx.ads/intm/webdev/www.codeguru.com/cpp/g-m/bitmap/icons/L11/1308329279/flex/WMBrands/MSFT_Win7_CPC_GEMS2_1na/msftwin7gemscpcronbob.html/3267544e51306f6f7a366741426f6f64?http://clk.atdmt.com/MRT/go/149873324/direct/01/" target="_blank"&amp;gt;&amp;lt;img src="http://view.atdmt.com/MRT/view/149873324/direct/01/1308329279"/&amp;gt;&amp;lt;/a&amp;gt;'); &amp;lt;/script&amp;gt;&amp;lt;noscript&amp;gt;&amp;lt;a href="http://mjxads.internet.com/RealMedia/ads/click_lx.ads/intm/webdev/www.codeguru.com/cpp/g-m/bitmap/icons/L11/1308329279/flex/WMBrands/MSFT_Win7_CPC_GEMS2_1na/msftwin7gemscpcronbob.html/3267544e51306f6f7a366741426f6f64?http://clk.atdmt.com/MRT/go/149873324/direct/01/" target="_blank"&amp;gt;&amp;lt;img border="0" src="http://view.atdmt.com/MRT/view/149873324/direct/01/1308329279" /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/noscript&amp;gt; <A HREF="http://63.236.18.118/RealMedia/ads/click_nx.ads/intm/webdev/www.codeguru.com/cpp/g-m/bitmap/icons@120x60-1,125x125-1,125x600,125x800,468x60-1,468x60-2,accessunit,accessunit_one,accessunit_three,accessunit_two,ciu,cp1,cp10,cp11,cp12,cp13,cp14,cp2,cp3,cp4,cp5,cp6,cp7,cp8,cp9,fl1,fl2,fl3,fl4,fl5,flex,house_ribbon,marketplace01,marketplace02,marketplace03,marketplace04,marketplace05,marketplace06,sitetext-1!flex" > <IMG SRC="http://63.236.18.118/RealMedia/ads/adstream_nx.ads/intm/webdev/www.codeguru.com/cpp/g-m/bitmap/icons@120x60-1,125x125-1,125x600,125x800,468x60-1,468x60-2,accessunit,accessunit_one,accessunit_three,accessunit_two,ciu,cp1,cp10,cp11,cp12,cp13,cp14,cp2,cp3,cp4,cp5,cp6,cp7,cp8,cp9,fl1,fl2,fl3,fl4,fl5,flex,house_ribbon,marketplace01,marketplace02,marketplace03,marketplace04,marketplace05,marketplace06,sitetext-1!flex" border=0> </A>

An Introduction to Microsoft .NET Services for Developers
This overview paper introduces Microsoft .NET Services, each of its building block services, and how they fit together. >>

PHP SDK for Windows Azure
This open source project, announced in May, is an effort to bridge PHP developers to Windows Azure. PHPAzure is an open source project to provide software development kit for Windows Azure and Windows Azure Storage b Blobs, Tables, and Queues. >>

Azure Services Platform Forum
Connect with other users and developers through MSDN community resources. There's a growing archive of technical questions and answers in the forum. >>
<A HREF="http://63.236.18.118/RealMedia/ads/click_nx.ads/intm/webdev/www.codeguru.com/cpp/g-m/bitmap/icons@120x60-1,125x125-1,125x600,125x800,468x60-1,468x60-2,accessunit,accessunit_one,accessunit_three,accessunit_two,ciu,cp1,cp10,cp11,cp12,cp13,cp14,cp2,cp3,cp4,cp5,cp6,cp7,cp8,cp9,fl1,fl2,fl3,fl4,fl5,flex,house_ribbon,marketplace01,marketplace02,marketplace03,marketplace04,marketplace05,marketplace06,sitetext-1!accessunit" > <IMG SRC="http://63.236.18.118/RealMedia/ads/adstream_nx.ads/intm/webdev/www.codeguru.com/cpp/g-m/bitmap/icons@120x60-1,125x125-1,125x600,125x800,468x60-1,468x60-2,accessunit,accessunit_one,accessunit_three,accessunit_two,ciu,cp1,cp10,cp11,cp12,cp13,cp14,cp2,cp3,cp4,cp5,cp6,cp7,cp8,cp9,fl1,fl2,fl3,fl4,fl5,flex,house_ribbon,marketplace01,marketplace02,marketplace03,marketplace04,marketplace05,marketplace06,sitetext-1!accessunit" border=0> </A>
MARKETPLACE
Advertise Here

Four years ago, Microsoft extended the .ico format and allowed 32-bit RGBA images (with an 8-bit alpha channel) inside .ico files. These icons are known as Windows XP icons and are easily recognized by their smooth, antialiased edges.

Beta 1 and Beta 2 of Windows Vista indicate that Microsoft is going to make another change to the .ico format. Icons in current Vista builds differ in two aspects from Windows XP icons:

The use of PNG compression is a breaking change. Windows XP and previous are only able to use those images from an icon that are not compressed.

The icon format allowed you to use 256x256 images before, so why did Microsoft introduce the PNG compression? I can only guess, but because the uncompressed icon with all Vista formats occupies more then 400 Kb, the answer is obvious.

Windows Vista Explorer uses the hi-res images and dynamically resamples them to the required resolution.

Problems Compiling Vista Icons

If you try to compile a Vista icon into application resources using the Visual Studio resource compiler, the tool aborts with error and refuses to accept the icon in the Vista format. This error is reported from all versions of Visual Studio, including VS 2005.

How to Use the Tool

The tool accompanying this article is able to replace or add an icon to an already compiled executable. It has an easy command line interface and can be configured to run as a post-build step in Microsoft Visual Studio.

Parameters

ReplaceVistaIcon.exe executable.dll icon.ico [icon_ID [language_code]]

The command will replace or add icon.ico to executable.dll. The icon will be replaced if you specify icon_ID; otherwise, it will be added to the list of icons.

Implementation

The tool does not modify the executable directly. Instead it uses the Win32 API for resource manipulation and works under all NT-based systems. There should be no compatibility problems because it links the static version of C runtime.

The implementation is pretty straightforward. The tool:

Points of Interest

I used the tool on itself and the compiled executable already contains a Vista-compatible icon (the one on the picture).

Conclusion

Vista is still in its beta phase and Microsoft will likely resolve the problems with the resource compiler by the time Vista is released, thus making this tool obsolete. (What compiler is Microsoft using to compile Windows Vista, anyway?)

Still, Microsoft may not issue a patch for all versions of their development environments and there are plenty of third-party Windows compilers, so the tool may have a place even after Microsoft addresses the issue.

Windows Vista delivers stunning visual capabilities and the new, hi-res icons are an inseparable part of it. Exploring and exploiting the new concepts of Vista is a exciting experience, especially for someone like me, who is involved in development of icon software.

Downloads

  • ExampleVistaIcon.zip - Example icon.
  • ReplaceVistaIcon.zip - Executable
  • ReplaceVistaIcon_src.zip - Sources

  • 转自http://www.codeguru.com/cpp/g-m/bitmap/icons/article.php/c11961

    http://www.google.cn/search?q=replacevistaicon&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:zh-CN:official&client=firefox-a

    类别:Wlss | 浏览() | 评论 (0)
     
    网友评论:
    发表评论:
    姓 名:
    网址或邮箱: (选填)
    内 容:
    验证码: 请点击后输入四位验证码,字母不区分大小写
          

         

    ©2009 Baidu