Public Group

# Custom resource in Dev C++

This topic is 4811 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

How do I get a custom resource into my resource file with DevC++? I'm trying to get my PNG images in there, but I cant get it to work.

##### Share on other sites
Could you show us some code, for example, the .rc file and how do you try to load the images (I guess you're using some library, which one if you do)?

Why doesnt it works exactly?

cheers

##### Share on other sites
I just need to get the PNG into the resource file, I can load bitmaps and stuff already.

##### Share on other sites
I some JPEGs a while back and it looked like this in the .rc file:

IDR_BACK_RINGS_NIGHT    JPEG    DISCARDABLE     "Img\\Backgrounds\\rings night.jpg"IDR_BACK_WATER          JPEG    DISCARDABLE     "Img\\Backgrounds\\water.jpg"IDR_BACK_ROSE           JPEG    DISCARDABLE     "Img\\Backgrounds\\rose.jpg"IDR_BACK_FLOWERS        JPEG    DISCARDABLE     "Img\\Backgrounds\\flowers.jpg"IDR_BACK_HELMET         JPEG    DISCARDABLE     "Img\\Backgrounds\\helmet.jpg"IDR_BACK_HIGH           JPEG    DISCARDABLE     "Img\\Backgrounds\\high.jpg"IDR_BACK_HUG            JPEG    DISCARDABLE     "Img\\Backgrounds\\hug.jpg"IDR_BACK_FIELD          JPEG    DISCARDABLE     "Img\\Backgrounds\\field.jpg"

and in my source I located them with:

HRSRC hrsrc = FindResource( 0, MAKEINTRESOURCE( nId ), "JPEG" );

where nId was the id like IDR_BACK_HELMET. You should be able to do the same thing but change the custom resource type ("JPEG") to be whatever you want.

1. 1
2. 2
3. 3
4. 4
frob
13
5. 5

• 16
• 13
• 20
• 12
• 19
• ### Forum Statistics

• Total Topics
632170
• Total Posts
3004550

×