Results 1 to 11 of 11

Thread: [2.0] Print a photo?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    [2.0] Print a photo?

    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!

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Print a photo?

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: [2.0] Print a photo?

    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?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Print a photo?

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: [2.0] Print a photo?

    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..

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Print a photo?

    Have you definitely assigned your PrintDocument to the Document properties of the other two dialogues?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: [2.0] Print a photo?

    Uh.. I think so.. Just in case.. How would I do that?

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Print a photo?

    How do you normally set a property?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: [2.0] Print a photo?

    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

  10. #10
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Print a photo?

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: [2.0] Print a photo?

    oh... ok.. i thought you were saying to change the printDocument's properties.. ok.. I'll try it now. thanks

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