954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

C++ open a picture

hi, i am just wondering how to open a picture of a normal format. I know that you cant do it in the console. And i am using the compiler DEV-C++. Thanks

thecoolman5
Posting Whiz in Training
234 posts since Dec 2010
Reputation Points: 18
Solved Threads: 1
 

Why can't you do it in the console?

Open the file in binary mode.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

You probably need to use an external library of some kind.

FreeImage is one which is easy to use, supports most standard image formats and allows you to do some basic transformations on them.

If you want to do more advanced transformations on the image, then you can use OpenCV .

If you just want to display the image, then I would suggest you use a GUI tool to make an application with a graphical user interface. Qt is a very good option as a GUI tool and C++ IDE for it. Any GUI tool will have features to load images.

Another option is WinAPI, which supports Bitmap files. There are of course more advanced solutions from Microsoft as well, but they mostly require Visual Studio to use them.

mike_2000_17
Posting Virtuoso
Moderator
2,138 posts since Jul 2010
Reputation Points: 1,634
Solved Threads: 457
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: