Is there any way i can display any image files (any extension) in C??
I heard that bitmap files can be displayed. Can anyone tell me how?
Printable View
Is there any way i can display any image files (any extension) in C??
I heard that bitmap files can be displayed. Can anyone tell me how?
Where do want them displayed and for what purpose? This is some specific system library stuff I think, so the method depends on the OS.
You can...only if you honour the cabbage
You can 'create' greyscale .pgm images using c, provided you already have a file for the image to be created to, in the same directory as the executable. I think you can do simialr things with coloured bitmaps, but not sure.
Of course you can create / edit / whatever bitmaps. It's basically just mathematical formulas.
Anyhow, you will probably want/need 3rd party libraries for that, seeing as it's complex.
The OS will do the job of displaying it on the screen for you.
You can create color bitmaps such as .xpm images using a text editor, and convert them to anything else using a system command. They are pure text files -- go look. So a simple C program to do the same thing would make it even easier.
However, that's different issue than actually displaying them.
I thought it was possible, but never actually tried it myself, seems an obvious enough extension of being able to read/write .pgm images though.
OP: If you want to program a GUI in c, then you can use GTK toolkit, and there is probably ways of creating and displaying images within that, but I'm not sure exactly what you mean by displaying an image.