Custom resource in Dev C++
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.
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
Why doesnt it works exactly?
cheers
I some JPEGs a while back and it looked like this in the .rc file:
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement