Question:
Hi...i am new to C++ and am using borland c++.I need to open a picture in my c++ program.what to do ?
arvind k
2009-01-22 08:10:07 UTC
is there any code for it ??...please help....urgent !!!
Three answers:
jplatt39
2009-01-22 09:00:07 UTC
Sure, there is code for it. It's not a subject for n00bies though. Pardon my bluntness but futzing around won't do much. Using Borland there are a lot of tutorials for opening PCX files, which are the simplest kind of files, and I'm sure there are libraries and tutorials for gif and jpg files.



I'll point you to a PCX tutorial. Be patient if the tutorial is in Pascal, the original was, then it was rewritten, more than ten years ago. Still works though. This computer is about two years old and it's worked on that:



http://www.hornet.org/code/tutors/denthor/



Now for something different, C/C++ uses libraries. By default your program links to the libc library. It won't run at all otherwise. There is a game playing (read graphics) library called Allegro it is worth commenting on:



http://alleg.sourceforge.net/



You compile it with the compiler you will use it with. There is a specific Borland/Turbo C++ makefile which you will use (follow the README instructions) and it should simplify graphics programming immensely while you figure out what you are doing. I will admit, I haven't used it in years, but that's also true of tcc (the Borland command line compiler).
Tom
2009-01-22 09:01:11 UTC
What do you mean by open a picture? Do you want to read the contents of a photo file (ie. jpeg) as data into your program? Are you looking for a way to have your program simply read and display the photo?
anonymous
2016-11-07 09:08:59 UTC
you would be greater effectual off utilising a sparkling and modern compiler and/or IDE. Why use previous technologies while new technologies is offered for unfastened. seen C++ 2010 show (registration is unfastened) Code::blocks (unfastened) MinGW compiler kit (unfastened)


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...