Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-15-2007, 01:02 AM
|
#1
|
LQ Newbie
Registered: Sep 2007
Posts: 12
Rep:
|
How to display BMP image at stdout.....help plz
Hi,
1> I am using Red hat EL.4. I want to display any BMP image (using C) at stdout. I have already used fread(). fwrite() and able to copy a image but yet to print at stdout.
when I am using the function 'fwrite(&file_structure,sizeof(file_structure),1,s tdout)' its giving me the corresponding characters at stdout.
2> I also want to know, how to use the graphics mode under linux using C. Is there any header file and function like windows '#include<graphics.h>' and 'initgraph()'
please help me.....
|
|
|
09-15-2007, 01:37 AM
|
#2
|
Senior Member
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038
Rep:
|
1) see as stdout is text, and its outputting characters, i say its working perfectly. What exactly where you trying to do, actually display the image?
2) Nope, well, there is the framebuffer, but really, there is little reason to use it, unless of course you need display graphics as a command line only program. You should look up graphical libraries. There are quite a few, the choice will mostly depend upon what type of graphics you are trying to display.
3) As a side note, if you where actually trying to display the image on the screen in question 1, then you need a graphical output to do that, not text based. A graphics library is the best way to go about it, as already mentioned.
http://wiki.linuxquestions.org/wiki/Graphics_libraries
|
|
|
09-15-2007, 02:11 AM
|
#3
|
LQ Newbie
Registered: Sep 2007
Posts: 12
Original Poster
Rep:
|
How to display BMP image at stdout.....help
Many many thanks for your help.....
|
|
|
09-15-2007, 04:15 AM
|
#4
|
LQ Newbie
Registered: Sep 2007
Posts: 12
Original Poster
Rep:
|
Thanks........
Quote:
Originally Posted by SciYro
1) see as stdout is text, and its outputting characters, i say its working perfectly. What exactly where you trying to do, actually display the image?
2) Nope, well, there is the framebuffer, but really, there is little reason to use it, unless of course you need display graphics as a command line only program. You should look up graphical libraries. There are quite a few, the choice will mostly depend upon what type of graphics you are trying to display.
3) As a side note, if you where actually trying to display the image on the screen in question 1, then you need a graphical output to do that, not text based. A graphics library is the best way to go about it, as already mentioned.
http://wiki.linuxquestions.org/wiki/Graphics_libraries
|
Thanks for your help.
I have downloaded and install g2-0.72 and trying to run a small
program. When compiled with gcc giving me errors as bellow...
any help?????????
#include <g2.h>
#include <g2_PS.h>
main()
{
int id;
id = g2_open_PS("rect.ps", g2_A4, g2_PS_land);
g2_rectangle(id, 20, 20, 150, 150);
g2_close(id);
}
[root@localhost C Programs]# gcc test.c
/tmp/cc8u4Gof.o(.text+0x29): In function `main':
: undefined reference to `g2_open_PS'
/tmp/cc8u4Gof.o(.text+0x6a): In function `main':
: undefined reference to `g2_rectangle'
/tmp/cc8u4Gof.o(.text+0x78): In function `main':
: undefined reference to `g2_close'
collect2: ld returned 1 exit status
|
|
|
09-15-2007, 07:17 AM
|
#5
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
Install ImageMagick and type
display <filename>
|
|
|
09-17-2007, 11:12 AM
|
#6
|
LQ Newbie
Registered: Sep 2007
Posts: 12
Original Poster
Rep:
|
Quote:
Originally Posted by AwesomeMachine
Install ImageMagick and type
display <filename>
|
Thanks......problem solved.
|
|
|
All times are GMT -5. The time now is 09:05 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|