User forums > Using Code::Blocks

Importing bmp's - resource files

(1/1)

Xorlium:
Hi... this may be a dumb question, but I just can't do it...

How do I import bmp's into a project for the resource compiler or something??

I can load files from within the program, but I don't know how to make the bitmaps part of the .exe :)

Thanks!

Urxae:
Looking at the Code::Blocks source, I see a file named resources.rc with lines like this:

--- Code: ---wxBITMAP_STD_COLOURS    BITMAP "wx/msw/colours.bmp"
--- End code ---

As I understand it, the first word is a name, the second is the type of resource (a bitmap file in this case, but ICON is also mentioned in the file) and the third is a filename (the resource data, I presume).
This bitmap is added to the project and set to compile and link into the main executable.

Now please don't ask me how to load that bitmap from the program, as I have no idea. I never needed to use that stuff :)
I'll let someone else answer that one.

Xorlium:
Thanks a lot! It worked perfectly. Just like that, make a "myapp.rc" file, and put in lines like:

MyPic BITMAP "pics/mine.bmp"

And that's it :)

Navigation

[0] Message Index

Go to full version