Custom resource in Dev C++

Started by
2 comments, last by MauMan 18 years, 10 months ago
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.
My Current Project Angels 22 (4E5)
Advertisement
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

I just need to get the PNG into the resource file, I can load bitmaps and stuff already.
My Current Project Angels 22 (4E5)
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.
---CyberbrineDreamsSuspected implementation of the Windows idle loop: void idle_loop() { *((char*)rand()) = 0; }

This topic is closed to new replies.

Advertisement