Thread: print a picture

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    33

    print a picture

    Hey all, anyone knows how can I print a picture in c++;
    CAN U GIVE ME A CODE? A SAMPLE?

    THANKS

  2. #2
    Banned
    Join Date
    Nov 2007
    Posts
    678
    Print?
    Do you mean, using printer?

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    33
    edited

  4. #4
    Registered User
    Join Date
    May 2008
    Posts
    33
    yes using printer..

    print a picture using printer, c++ code

  5. #5
    Banned
    Join Date
    Nov 2007
    Posts
    678
    Tell us, which Operating System and C++ compiler you are using?
    It will help others to suggest you an easy solution.

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    This is platform specific, unfortunately, since C++ has no library for that.
    What are you developing for? Windows, Linux, Mac?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    Registered User
    Join Date
    May 2008
    Posts
    33
    Ubuntu, gcc compiler..

  8. #8
    Registered User
    Join Date
    May 2008
    Posts
    33
    can I get a sample code that does this!

  9. #9
    Registered User
    Join Date
    Apr 2008
    Posts
    890
    Quote Originally Posted by moussa View Post
    can I get a sample code that does this!
    Probably, if you Google for it.

  10. #10
    Registered User
    Join Date
    May 2008
    Posts
    33
    I already googled, didnt find anything.

    can i just like windows , call system(print watever..)


    how it works in linux?

  11. #11
    Registered User
    Join Date
    May 2008
    Posts
    33
    FILE * fpPrint; // file handle for printing
    fpPrint = fopen( "PRN:" ); // open the printer port
    fprintf( fpPrint, "testing" ); // write to the printer
    fclose( fpPrint ); // close the printer port

    this code aint enough

  12. #12
    Registered User
    Join Date
    May 2008
    Posts
    33
    I Want To Print A Picture

  13. #13
    Beginner in C++
    Join Date
    Dec 2007
    Posts
    34
    Can't you post an idea? Even if it's wrong it's still better us to write the whole code for you.
    Ubuntu Linux / Vista Home Premium (for games)
    SCiTE text editor, G++ compiler

  14. #14
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by moussa View Post
    FILE * fpPrint; // file handle for printing
    fpPrint = fopen( "PRN:" ); // open the printer port
    fprintf( fpPrint, "testing" ); // write to the printer
    fclose( fpPrint ); // close the printer port

    this code aint enough
    If this were to be correct, then you could just load the printer and (probably) write it to the "printer file". It would probably give you something.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  15. #15
    Banned
    Join Date
    Nov 2007
    Posts
    678
    Actually I can hint only, I have not done anything like this before.
    But since everything is a file on Linux, you can try opening printer device as a file, and write to it.

    Please, I can't say if it will work or not. Let us have some expert's advice about this. First.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to print an array like in this picture..
    By transgalactic2 in forum C Programming
    Replies: 20
    Last Post: 01-03-2009, 08:28 AM
  2. merging linked lists
    By scwizzo in forum C++ Programming
    Replies: 15
    Last Post: 09-14-2008, 05:07 PM
  3. Personal Program that is making me go wtf?
    By Submeg in forum C Programming
    Replies: 20
    Last Post: 06-27-2006, 12:13 AM
  4. Scope And Parameter Passing
    By djwicks in forum C Programming
    Replies: 6
    Last Post: 03-28-2005, 08:26 PM
  5. What kind of programs should I start writing?
    By Macabre in forum C++ Programming
    Replies: 23
    Last Post: 04-12-2003, 08:13 PM