Click to See Complete Forum and Search --> : How to print image (JPG) file through printer?


jamesguitar
November 24th, 2008, 02:07 AM
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

Igor Vartanov
November 24th, 2008, 09:53 AM
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.

jamesguitar
November 24th, 2008, 02:49 PM
Hey Igor Vartanov,

Thanks, let me do some research about it.

James

Laurentis
November 25th, 2008, 06:43 AM
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.

Igor Vartanov
November 25th, 2008, 10:06 AM
Just print it directly with COM.:D Please explain this "directly with COM".

jamesguitar
November 25th, 2008, 09:37 PM
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

Laurentis
November 26th, 2008, 05:54 AM
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-windows.programmer.win32
where it's a Win32 usual question for a long time...

Igor Vartanov
November 26th, 2008, 12:45 PM
Yes, with COM and IE (you let IE doing all the printing)
see news://194.177.96.26/comp.os.ms-windows.programmer.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. :D