vc编译错误pass it through SDKPAINT的处理方法

本文介绍了解决VC6在编译过程中出现的图标错误的方法。主要问题是图标使用了PNG压缩,导致资源编译失败。文章提供了使用IconWorkshop去除压缩的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

vc编译错误pass it through SDKPAINT的处理方法

 

在使用网上提供的图标给VC6使用,在编译的时候会提示“Error RC2176: old DIB in res\app.ico; pass it through SDKPAINT”,原因是这些图标里使用了压缩来缩小图标的尺寸。

 

下文的意思就是用IconWorkshop工具,取消图标中的压缩,重新保存图标(图标会大很多),OK!一切搞定!VC6能够编译通过了。

 

事实就这么简单。。。

 

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 (error RC2176 : old DIB in res****.ico; pass it through SDKPAINT - 剑雨花心 - 曲郎博客). 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 (error RC2176 : old DIB in res****.ico; pass it through SDKPAINT - 剑雨花心 - 曲郎博客).

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 (error RC2176 : old DIB in res****.ico; pass it through SDKPAINT - 剑雨花心 - 曲郎博客) 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.

转载于:https://www.cnblogs.com/yxsylyh/archive/2011/11/04/vciconerror.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值