Thread: Images

  1. #1
    Registered User
    Join Date
    Dec 2006


    I am trying to figure out how to just show 2 basic images (I dont care what type of format the picture is in) and I found this thing called a LoadImage() function but I have no idea how to use it and google wasn't being really helpful. So can someone help point me to a tutorial of some sort so I can figure out what to do

    Thanks for reading this

  2. #2
    Join Date
    Jan 2005
    I think this is what you are looking for. In particular lesson 13.

  3. #3
    Hardware Engineer
    Join Date
    Sep 2001

    FYI - A bitmap (pixel-map) is the simplest/easiest format to use. A bitmap file is just an array that contains 3 numbers (3 colors) for each pixel that make-up the image. (For a black & white image, you only need one gray-scale number for each "dot".)

    It's fairly easy to display a bitmap or to create simple graphics in a Windows GUI application... once you have a Windows Application. You might have to re-scale the image, depending on the size of the bitmap, the size of your window and your monitor resolution. But, that's easy too. However, it's not so easy to write a "simple" Windows program.

    If you want to display a compressed format such as JPEG, you need to decode it first (essentially, convert it to a bitmap). You can get libraries to do that, and I think Visual C++ comes with functions to decode the common formats. Or if you want a challange, you can write your own. If you want to write your own decoder, you can get information on various file formats at

    All of this is platform specific. So for example, Loadimage() may not work on a Linux system. (There is no color, graphics, mouse, sound, or networking in ANSI/ISO Standard C++. All of these are platform specific.)
    Last edited by DougDbug; 12-22-2006 at 01:18 PM.

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    You can use GCC's libpng etc to load images.

    I think, though, that if someone can't find information about LoadImage they might not be up to programming that kind of thing. You could use an external program. For Windows, you could always launch the default image viewer.
    system("start image.bmp");

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell

    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ:

    My website:
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Images
    By _Nate_ in forum C Programming
    Replies: 4
    Last Post: 05-18-2008, 10:50 PM
  2. Images
    By gvector1 in forum C++ Programming
    Replies: 7
    Last Post: 02-25-2003, 09:59 AM
  3. images, icons, and cursors, OH MY!
    By DarkViper in forum Windows Programming
    Replies: 3
    Last Post: 01-07-2003, 02:26 PM
  4. STL, Queues And Images
    By simly01 in forum C++ Programming
    Replies: 3
    Last Post: 06-24-2002, 12:31 PM
  5. A simple question on Images....
    By LonelyPlanetWa in forum C Programming
    Replies: 7
    Last Post: 05-20-2002, 07:34 AM