Advertisement Jump to content
Sign in to follow this  
Sir Sapo

Custom resource in Dev C++

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

If you intended to correct an error in the post then please contact us.

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 this post

Link to post
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?


Share this post

Link to post
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.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!