views:

1306

answers:

2

I have a resource DLL project in VS2008 that contains mostly PNG images. Every time I import a new image to the resource file, I get an RC2170 error: bitmap file is not 3.0 format, for every PNG that was previously in the resource file.

Thing is, all of those iamges have complied ok before I add the new image. Only after I remove all of those images from the resource file, and import them again (unchanged), it would compile.

This behavior repeats itself for every new PNG file added, and as the number of PNG files grows, it becomes increasingly annoying.

Anyone experienced anything similiar? Any solution?

BTW: I don't actually need the resource editor to recognize the PNG files as images, if that may solve this.

A: 

The resource editor does not directly support PNG images. You have to add them as binary files like this:

IDI_BACKGROUND  RCDATA    "background.png"

Then you can use GDI+ to load them from your resource file. This is explained in this article (C++)

StackedCrooked
A: 

According to this thread, you are experience a bug in the resource editor which changes:

IDI_DENTIFIER PNG "background.png"
to:
IDI_DENTIFIER BITMAP "background.png"

But beware: these PNG resources do not seem to load on pre-Vista OS when called via LoadImage(). Using this resource type may limit your application to Vista.

Heath Hunnicutt