Results 1 to 6 of 6

Thread: Print Image

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    5

    Print Image

    Hi there,

    what i need to do is print an image from a PictureBox when a button is clicked.

    PictureBox is called: pictureBoxFinal

    Image needed to print i guess will be: pictureBoxFinal.Image

    Button is called: buttonPrint

    can anyone give me the code required to do this.

    many thanks!
    dave

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

    Re: Print Image

    I suggest that you download the 2003 101 samples (see my signature for a link) and check out the printing example. It deals with printing text but the principles are exactly the same regardless of what you're printing. In the PrintPage event handler you simply need to substitute DrawImage for DrawString.
    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
    New Member
    Join Date
    Apr 2006
    Posts
    5

    Re: Print Image

    Cheers mate, i'll take a peek!

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    5

    Re: Print Image

    Still having trouble with this code, if anyone can help please let me know.

    Dave

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

    Re: Print Image

    Add a PrintDocument to your form. Double-click it to create a handler for its PrintPage event. That's where the actual printing occurs. When you want to print call the Print method of the PrintDocument.
    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

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    5

    Re: Print Image

    Have nothing at the moment mate cos i'm stumped.

    I'm a beginner in every sense of the word so need real help. You want to take a look at my actual work?

    Thanks!
    Dave

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