Thread: how bout imaging?

  1. #1
    Unregistered
    Guest

    Question how bout imaging?

    is there any way to use c++ to load and work with image files such as jpg and other image formats? I am a beginner to the language but need something more interesting than simply dealing with consoles and text messages to really get into it. any help would be greatly appreciated.

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    There is really no easy way. Unfortunately, the only alternate to API calls are video interrupts, I believe. Windows API calls were not designed for the high-level graphic manipulation you may expect from an OS. This is mainly to discourage lazy people from developing applications quickly I guess. You just have to be patient and learn it little by little, and encapsulate it into say a C++ library to enable quicker development in your apps.
    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
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    >is there any way to use c++ to load and work with image files such as jpg and other image formats?

    Yes of course. But C++ is language, not an API itself for dealing with images. You would either need to write the code to read JPEG (or whatever) and render them. Or

    use someone elses API. Windows has basic API functions for handling bitmaps, but you may need something else for more sophisticated projects. Try

    www.hicomponents.com

    as a start.
    OS: Windows XP
    Compilers: MinGW (Code::Blocks), BCB 5

    BigAngryDog.com

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    You will need the latest version of GDIplus.dll to use anything apart from bitmaps.

    GDI+ will allow the use of JPG's and many other image formats. I use a library from Smalleranimals software to do image manipulation.

    What did you want to do to the images? Redraw them or process them for info (ie OCR)?

    look here for GDI+ info
    http://www.codeguru.com/gdi/GDIPlus.html

    or MSDN
    http://msdn.microsoft.com/library/de...asp?frame=true
    "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. high dynamic range imaging
    By arjunajay in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 09-21-2006, 07:36 PM
  2. TIFF in MO Document Imaging
    By xmltorrent in forum Tech Board
    Replies: 1
    Last Post: 03-30-2006, 04:04 PM
  3. Imaging prg
    By sidideas in forum C Programming
    Replies: 4
    Last Post: 10-11-2005, 12:43 PM
  4. frustrated bout char array
    By royuco77 in forum C++ Programming
    Replies: 2
    Last Post: 07-11-2005, 09:10 AM
  5. Question bout displaying with colors
    By Unregistered in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2002, 05:52 PM