How to read image?

I am on Windows, using Visual Studio C++ 2010 Express

Is there any class or method for GDI which could read jpg, png or bmp images? Maybe tiff too.
The class Image is for payed versions of Visual Studio. I have not payed version.

On Rosetta code there is some code using imglib.h
http://rosettacode.org/wiki/Read_image_file_through_a_pipe
Do you know where can I get save download of imglib?
The class Image is for payed versions of Visual Studio. I have not payed version.
Really? I don't think so. It's GDI+ though.

Do you know where can I get save download of imglib?
They use ImageMagick:

http://www.imagemagick.org/
coder777: then can you tell me what I must do, to include Image library in my project?
#include <image.h>
or
#include <image>
is fatal error. Do I must include some .lib file? I did not found it on the link.


Also there is written:
Applies to: desktop apps only.

I don't think I have desktop app.
Last edited on
Finally I have found some good answer
http://stackoverflow.com/questions/694080/how-do-i-read-jpeg-and-png-pixels-in-c-on-linux
but I am surprised. When I open the lib png project, the file png.h is not class. They don't use namespace or classes to access the libpng. That looks kind of weird to me. What if I want to build program (dll library) which should use the libpng library. Will not be that problem that they don't use class?

Edit:
libpng does not use classes or namespace and has dependency on zlib.

Better library for png:
http://lodev.org/lodepng/
no dependency, uses class, clear design
Last edited on
Yes, those libraries exist. I'd say that ImageMagick do use them too. In any case you need to install the library and set up your project so that you can use the header and libs.

Will not be that problem that they don't use class?
No, in opposite: C++ classes are due to name mangling bound a certain compiler.

c functions can be used even from other languages.

What if I want to build program (dll library)
In case of dll you must be careful with memory. You must not free memory that is allocated within the dll and vice versa
Registered users can post here. Sign in or register to post.