PDA

Click to See Complete Forum and Search --> : [2.0] Print a photo?


Fromethius
Feb 20th, 2007, 03:34 PM
One of my printer's can print 4x6 photos.. However.. How would I do this? I'm a total noob to printing btw so if u guys could be extremely specific that would be great!

jmcilhinney
Feb 20th, 2007, 04:29 PM
All printing is done the same way and you can find plenty of examples. You create a PrintDocument, call its Print method and handle its PrintPage event. In the event handler you use GDI+ to draw what you want printed via the e.Graphics property. If you want to draw text you call DrawString. If you want to print a picture you call DrawImage.

Fromethius
Feb 20th, 2007, 06:04 PM
Yea.. I know how to print images.. But how do I print photos? No matter what setting i put in the printdialog it always prints to a 8x11 sheet. How can I print onto a photo card and with the photo quality?

jmcilhinney
Feb 20th, 2007, 06:09 PM
I've only ever done basic printing to the default printer but I think that if you attach your PrintDocument to a PrintDialog and/or a PageSetupDialog then that should allow the user to make whatever changes are required. If you don't want the user to have to make those changes each time I'd suggest testing it like that and then see what changes have been made to the PrintDocument afterwards. You can then reimplement to make those changes in code yourself.

Fromethius
Feb 20th, 2007, 06:31 PM
Yea well my dad said that the printer has the photos things in it and then in word he went to print and then 4x6 and it came out a pretty photo and then with my program i went to 4x6 and it was the exact same setting in word and then i printed and it came out normal on a normal white paper. so..

jmcilhinney
Feb 20th, 2007, 07:57 PM
Have you definitely assigned your PrintDocument to the Document properties of the other two dialogues?

Fromethius
Feb 20th, 2007, 09:21 PM
Uh.. I think so.. Just in case.. How would I do that?

jmcilhinney
Feb 20th, 2007, 09:43 PM
How do you normally set a property?

Fromethius
Feb 21st, 2007, 02:29 PM
I'm sorry John but I just don't see it.. Do I have to assign the dialog to the printer or soemthing?.. I mean.. No matter what I change in the dialog it doesn't effect printing the page.. I really don't get this stuff

jmcilhinney
Feb 21st, 2007, 02:58 PM
I don't know if this will fix your problem or not but it may well do because if you had already assigned the PrintDocument to the Document property of the PageSetupDialog and/or PrintDialog I would think you'd know. Like I said, how do you normally set a property? In the Properties window is how. Select you PageSetpDialog or your PrintDialog in the designer, go to the Properties window, select the Document property then select your PrintDocument from the drop-down list. This is asuming that you've added all these components in the designer, which I would highly recommend.

Fromethius
Feb 21st, 2007, 08:27 PM
oh... ok.. i thought you were saying to change the printDocument's properties.. ok.. I'll try it now. thanks