CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2008
    Posts
    6

    How to print image (JPG) file through printer?

    Hi there,

    I am having a problem about the printer in windows XP.

    Does anyone know how to print out the image (JPG) file from the printer by c++ and WinAPI?

    Any idea will be helpful.

    Appreciate it.

    James
    Last edited by jamesguitar; November 24th, 2008 at 04:11 AM. Reason: typo

  2. #2
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: How to print image (JPG) file through printer?

    The idea is to handle this as usual bitmap printing. Load JPG with GDI+, open printer DC, blit an image to DC. End of story.
    Best regards,
    Igor

  3. #3
    Join Date
    Nov 2008
    Posts
    6

    Re: How to print image (JPG) file through printer?

    Hey Igor Vartanov,

    Thanks, let me do some research about it.

    James

  4. #4
    Join Date
    Jan 2008
    Posts
    48

    Re: How to print image (JPG) file through printer?

    Quote Originally Posted by Igor Vartanov View Post
    The idea is to handle this as usual bitmap printing. Load JPG with GDI+, open printer DC, blit an image to DC. End of story.
    No, wrong method.
    You don't need at all to load the jpg (and you don't need GDI+ for JPG)
    Just print it directly with COM.

  5. #5
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: How to print image (JPG) file through printer?

    Quote Originally Posted by Laurentis View Post
    Just print it directly with COM.
    Please explain this "directly with COM".
    Best regards,
    Igor

  6. #6
    Join Date
    Nov 2008
    Posts
    6

    Re: How to print image (JPG) file through printer?

    Hi
    Thanks Laurentis.
    But I am confused too.
    Would u please have more explanation.

    Also I am thinking another way.
    Actually, I am modifying a virtual printer code.
    So, when the user generate the "image" file through virtual printer, I need to print the file out via the real printer too.

    Therefore, I am thinking whether it is possible to copy the print job to the real printer's queue in the same time.

    Sorry, I am a newbie in Winapi programming.

    Any idea is appreciated.

    Thanks.

    James

  7. #7
    Join Date
    Jan 2008
    Posts
    48

    Re: How to print image (JPG) file through printer?

    Quote Originally Posted by jamesguitar View Post
    Hi
    Thanks Laurentis.
    But I am confused too.
    Would u please have more explanation.
    Yes, with COM and IE (you let IE doing all the printing)
    see news://194.177.96.26/comp.os.ms-wind...ogrammer.win32
    where it's a Win32 usual question for a long time...

  8. #8
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: How to print image (JPG) file through printer?

    Quote Originally Posted by Laurentis View Post
    Yes, with COM and IE (you let IE doing all the printing)
    see news://194.177.96.26/comp.os.ms-wind...ogrammer.win32
    where it's a Win32 usual question for a long time...
    Great, but definitely no, thanks. I'd like to print images some less twisted way.
    Best regards,
    Igor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured