Thread: Loading Pics

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    3

    Unhappy Loading Pics

    Hello, just a few questions here.

    I am righting an RPG game using the MFC dialogs, and would like to have pictures that will change for different monsters/players.

    What is the easiest way to do this?

    Only thing i could come up with is by adding all the pictures to the dialog and hiding/showing them when needed, but there has to be a better way.

    Any help would be very much appreciated.

    Thanks

    P.S. i will attach my prog so if any of you want to try it you can. You must have a compiler however to run the MFC to try it.

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Only thing i could come up with is by adding all the pictures to the dialog and hiding/showing them when needed, but there has to be a better way.
    ...welcome to the world of Windows, bro
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    If if you had direct access to the video memory you would have to do the same thing. This is the best way to do what you are doing since it keeps the images in memory instead of loading them off the hard disk on every usage.

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    With GDI++ you can load images other than bitmaps.
    You could even keep all the images as one large file and remember the offset from the begining to each image. ie stack all the images on top of each other.

    I would use LoadImage() and two or more DC's (an array). As the app starts, load each image from file, draw to a DC in the array.

    When needed just copy the whole DC containing the image to your framebuffer DC and call for a paint.

    Remember to free any GDI resources used after returning the DC to its original state.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cargo loading system
    By kyle rull in forum C Programming
    Replies: 1
    Last Post: 04-20-2009, 12:16 PM
  2. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  3. Loading a bitmap (Without using glaux)
    By Shamino in forum Game Programming
    Replies: 7
    Last Post: 03-16-2006, 09:43 AM
  4. need help with .md3 file loading
    By Shadow12345 in forum Game Programming
    Replies: 2
    Last Post: 12-06-2002, 04:06 PM
  5. Loading Screen
    By pinkcheese in forum Windows Programming
    Replies: 2
    Last Post: 04-06-2002, 11:48 PM