Thread: Graphics, Resource Files

  1. #1
    Registered User DeanDemon's Avatar
    Join Date
    Nov 2002
    Posts
    37

    Question Graphics, Resource Files

    How do I add graphics to my resource files? I know it varies from compiler to compiler, but just tell me how it's done with the compiler you use. (And make sure you tell me which compiler you're talking about when you do)

    Thanks
    -Dean

  2. #2
    Registered User MathFan's Avatar
    Join Date
    Apr 2002
    Posts
    190

    *.rc

    Here is how it is done in BC++B:

    code (game.rc):
    //------------------------------------------------------------------------------
    INTRO BITMAP .\\GrafX\\Intro\\smile.bmp
    MENU BITMAP .\\GrafX\\Menu\\menu.bmp
    ARROW BITMAP .\\arrowtt.bmp
    MAZE BITMAP .\\maze.bmp
    UNITS BITMAP .\\units.bmp

    //it's the first word (INTRO, MENU, etc.) you will use to recall the graphics in your code
    //------------------------------------------------------------------------------

  3. #3
    Registered User dead_cell's Avatar
    Join Date
    Jun 2002
    Posts
    44

    *.rc

    In Bloodshed Dev-C++ 4.0, Click on the [Project] tab in the menu bar at the top of the screen, then click [Edit resource file]. From there, you can manually ad a resource by naming the resource handle (default is MyResource1,2,3,4,...), then typing [BITMAP "wherever the bitmap is on your drive"].

    Or, you can add a bitmap resource by utilizing the built-in wizard - click on the "Insert Bitmap Resource" button (hover you mouse over the options) and browse for your bitmap on your hard drive/removable media/etc and give it a resource ID. Hit OK, then you should be done
    Linux is great - It does infinite loops in five seconds!

    ~Linus Torvalds

  4. #4
    Registered User dead_cell's Avatar
    Join Date
    Jun 2002
    Posts
    44

    *.rc (2)

    In Micro$oft's Visual C++.NET, under your solution explorer, add a resource file if you haven't done so already, then right-click on the resource file and hit "Open". You should now see the resource viewer. Right-click again on the resource file and hit "Add Resource". You will be brought to a menu where you can choose the type of resource you want to add. Click on "Bitmap", then hit the "Import" button on the right. Choose your Bitmap, then you're done!
    Linux is great - It does infinite loops in five seconds!

    ~Linus Torvalds

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. graphics....linking resource files...
    By ssjnamek in forum C++ Programming
    Replies: 4
    Last Post: 08-18-2005, 11:32 PM
  2. I Need To Know Some Things That I Can Put Into A Batch File
    By TheRealNapster in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-20-2003, 08:12 PM
  3. Beginer looking for an intro to graphics in C++...
    By scooby13q in forum C++ Programming
    Replies: 17
    Last Post: 06-07-2002, 05:19 PM
  4. resource files
    By satriani in forum C Programming
    Replies: 0
    Last Post: 12-31-2001, 02:26 PM
  5. Problems with resource files
    By Unregistered in forum C++ Programming
    Replies: 18
    Last Post: 08-31-2001, 08:45 AM