vc编译错误pass it through SDKPAINT的处理方法
转载于:http://hi.baidu.com/suntiancity/item/e20b9ef82c737bb531c19987
vc编译错误pass it through SDKPAINT的处理方法
在使用网上提供的图标给VC6使用,在编译的时候会提示“Error RC2176: old DIB in res\app.ico; pass it through SDKPAINT”,原因是这些图标里使用了压缩来缩小图标的尺寸。
下文的意思就是用IconWorkshop工具,取消图标中的压缩,重新保存图标(图标会大很多),OK!一切搞定!VC6能够编译通过了。
事实就这么简单。。。
在软件项目中使用Windows Vista压缩图标
使用Visual C + + 6.0和.NET 2003/2005的一个项目创建一个256x256的PNG图标
创建一个256x256的所有格式图标,以无压缩的256x256的格式保存你的图标。如果图标已经包含PNG压缩(已经创建了一个:从现有的图像制作Windows Vista图标),请遵循以下步骤:
1.打开包含在IconWorkshop压缩格式的PNG图标的图标文件。
2.在文档窗口的左侧,用户会看到所有可用的格式。找到256x256的被压缩的格式:一个小的覆盖图标表示压缩显示()。针对其中的每一个图标,请执行以下步骤:
3.右键单击格式,选择PNG压缩图像格式(Windows Vista,删除压缩)。
4.保存图标,重做256x256的图标的项目的相同的程序。
该图标保存不压缩的情况下,像往常一样进行工作。只要不是PNG图标,图像编译器会准确处理图标。当项目完成和发布的程序文件之前,请遵循以下步骤:
1)打开EXE文件,其中包含在IconWorkshop中未压缩的图标。
2)所有的嵌入的图标显示在文档窗口中,打开该文件,一定要显示所有格式的原料:选择“ 查看/显示图标/在RAW格式 “。
3)双击想要的图标压缩。它在另一份文件窗口中打开。
4)在列表中可用的格式(左边的垂直列表)中,右键单击第一个“256x256的RGB / A”格式,打开一个菜单,选择“ PNG压缩图像格式(Windows Vista)”。一个表示压缩的小的覆盖图标()显示。
5)如有其他的256×256的图像格式(如有的话),重复步骤4。
6)保存图标,文件/保存,关闭图标窗口。
7)返回至EXE文件窗口中,用户可以看到压缩覆盖图标()上显示256x256的格式。为所有包含256×256的图像(如果有的话)重复步骤3到6的所有其他图标,。
8)保存EXE文件,关闭该窗口。
Windows Vista? PNG compressed 256x256 icons are supported in Microsoft Visual Studio? 2008. We've tested PNG compressed icons on Visual C++ 6.0 and Visual .NET 2003/2005 and they all reject the icon during the resource compilation:
Error RC2176: old DIB in res\app.ico; pass it through SDKPAINT
This is unsurprising to us since this new ICO file format introduces a new header which points to raw PNG data. Of course the compiler returns a false error message. The DIB header is not old, it is PNG. Passing it through SDKPAINT does not help.
Windows Vista? compressed icons have also been reported as not functioning in the Delphi programming environment. New components will no doubt be developed in the future that identify these shortfalls.
Creating a project using a 256x256 PNG icon with Visual C++ 6.0 and .NET 2003/2005
Create a 256x256 icon with all formats embedded as recommended for Windows Vista?. Save your icon without compressing your 256x256 formats. If your icon already contains PNG compression (like the one we've created in the procedure above), follow this procedure:
1. Open the icon file containing the PNG compressed formats icon in IconWorkshop.
2. On the left side of the document window you see all the formats available. Locate the 256x256 formats which are compressed: A small overlay icon indicating the compression is displayed (). For each of them, do the following step:
3. Right click on the format (in the list if available formats, not in the editor area). A menu opens, choose "PNG Compressed Image Format (Windows Vista)" to remove the compression.
4. Save the icon. Redo the same procedure for all the 256x256 icons of the project.
Once the icon is saved without compression, work on your project as usual. The compiler will handle the icon images correctly since they are not PNG. When your project is finished and before releasing the program file, follow the procedure below:
1. Open the EXE file containing the uncompressed icon in IconWorkshop.
2. The file opens in a document window with all the embedded icons displayed. Be sure to display all the formats in raw: choose "View/Display Icons/All Formats In Raw".
3. Double-click on the icon you want to compress. It opens in another document window.
4. In the list of available formats (vertical list on left), right-click on the first "256x256 RGB/A" format, a menu opens. Choose "PNG Compressed Image Format (Windows Vista)". A small overlay icon indicating the compression is displayed ().
5. Repeat step 4 with the other 256x256 image formats (if any).
6. Save the icon "File/Save". Close the icon window.
7. Back in the EXE document window, you see the compression overlay icon () displayed on all the 256x256 formats. Repeat steps 3 to 6 for all the other icons containing 256x256 images (if any).
8. Save your EXE document, close the window.
9. You're done! The EXE file size is smaller indicating that the compression is made.

浙公网安备 33010602011771号