how can i print a picture file (say a file created using paintbrush) to the screen in c/c++?
is it possible?
how can i print a picture file (say a file created using paintbrush) to the screen in c/c++?
is it possible?
>is it possible?
Yes. But you'd need either an API that works with the file type you intend to display, or you need the details of that file type (obtainable from www.wotsit.org) so that you can do it manually.
what exactly is an API?
please forgive my ignorance but i have only worked on turbo c++
>what exactly is an API?
Application Programming Interface. It's basically a library of functions and types that helps you to do something without having to do it all by hand.
>please forgive my ignorance but i have only worked on turbo c++
How convenient, Turbo C++ supports the BGI API. Read your documentation for how to use it.
thanks very much for the info.
well if you just can get the putpixel function working from some API you can some what print the BMP on the screen..(even console screen)... but for JPEG or anything else you will require API's that deal with that specific format..
The reason being that BMP is not compressed and you can pretty much directly read the RGB values where as in other file formats are compressed and you need appropriate algorithms to handle them... The chess game I had posted here long back made use of simple fread and putpixel to print the BMP on console window.. you can search for that.
just forgot and my example above made use of the BGI graphics library in Turbo C so should be easy for u to follow..
Placing information on the screen has nothing to do with reading a file format. They're two entirely different tasks. If you have them as one in the same function, I'd suggest a rewrite of your code.
Quzah.
Hope is the first step on the road to disappointment.