|
-
Dec 13th, 2010, 03:50 PM
#1
Thread Starter
Lively Member
Print picture from file
Hi, i have a form with ten buttons on it.
what i want to do is, when i click Button1, it will print Picture1.jpg from a file, and when i click Button2, it should print Picture2.jpg from a file.
Also, i dont want the user to have to wait between the button clicking(for buffering).
Thanks for your help!
-
Dec 13th, 2010, 06:45 PM
#2
Re: Print picture from file
You could print it yourself in code or you could use Process.Start to have the file printed externally by the default application. The second option is equivalent to right-clicking the file in Windows Explorer and selecting Print. Note that you don't get to choose the app though. Do you have a preference?
-
Dec 14th, 2010, 02:09 PM
#3
Thread Starter
Lively Member
Re: Print picture from file
How would it work if i print it in code?
I don't want any dialog box to appear. i just want it to print.
thanks!
-
Dec 14th, 2010, 05:38 PM
#4
Re: Print picture from file
 Originally Posted by vbginner
How would it work if i print it in code?
I don't want any dialog box to appear. i just want it to print.
thanks! 
You would create a PrintDocument, call its print method, handle its PrintPage event and then call e.Graphics.DrawImage in the event handler. Merrion has posted a beginners guide to printing in the VB.NET CodeBank forum, so you might like to check that out for some guidance.
-
Dec 15th, 2010, 12:02 AM
#5
Thread Starter
Lively Member
Re: Print picture from file
Hi thanks for the help, but i'm a newbie, so i don't quite understand what your'e saying. Can you please give me an example in code to make things easier?
thanks alot!
-
Dec 15th, 2010, 12:29 AM
#6
Re: Print picture from file
No, I'm not going to provide an example when I've already directed you to where you can find the information you need.
Merrion has posted a beginners guide to printing in the VB.NET CodeBank forum, so you might like to check that out for some guidance.
Have you gone to the VB.NET CodeBank forum and looked for it? There's a link to that forum at the top of the VB.NET forum home page or you can use the list of all forums on the site home page. Finding that information has nothing to do with programming so being a newbie is not a problem. If you can use the web, you can find that printing guide.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|