borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (i have problems with print margins)Next Topic (Printing the pictureBox) New Topic New Poll Post Reply
AndreaVB Forum : Printing : print a whole picture box or form at 600 dpi including the controls over it, is it possible?
Poster Message
genius
Level: Trainee

Registered: 22-10-2004
Posts: 3

icon print a whole picture box or form at 600 dpi including the controls over it, is it possible?

Hi guys here am i at your service, but this time i need help rather than giving help. I want to print a whole form or picture box including controls over it at 600 dpi or atleast at 300 dpi resolution. many of you who have become gurus may know that when we print using printer.print and printer.paintpicture then we use maximum possible resolution of printer. currently i am using this way but it is a lot more time comsuming than a person can imagine. You know when u print a form then it prints the labels on it at a very high resolution which your printer supports or selected at the time but as far as pictureboxes and images cousern on it they are at screen resolution like less than 100 dpi. it is very disappointing. is there any one who can help me by providing me an easy method like printform. or if you have written a module to print form on high resolution or atleast print a picture box (including controls over it) to print at high resolution like 300 dpi or more. i will be thankful for an early reply which i am expecting from this form and nice people. it is a high level problem so i dont think an oridinary person can answer it. so i am hoping for an answer from any experienced person.

____________________________
Ask me any thing provided that i can ask you as well because nearly no one is perfect in this world.

22-10-2004 at 05:38 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: print a whole picture box or form at 600 dpi including the controls over it, is it possible?

Hi,
Have you tried setting the "Printer.PrintQuality = 300" rather than just using the default constant of "vbPRPQHigh".
It is possible to set any value provided the printer supports it.


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

22-10-2004 at 09:28 AM
View Profile Send Email to User Show All Posts | Quote Reply
genius
Level: Trainee

Registered: 22-10-2004
Posts: 3
icon Re: print a whole picture box or form at 600 dpi including the controls over it, is it possible?

it doesnt work.
Printer.PrintQuality = 300
Me.PrintForm
i am using a 600 Dpi printer
i have also checked it with other printers. it doestnt work with any one of them.
the result is same pixeletated as without printer.printQualility statement
what shoudl i do   
isnt there any way for me to print at 300 or 600 dpi
plz solve my problem

____________________________
Ask me any thing provided that i can ask you as well because nearly no one is perfect in this world.

25-10-2004 at 05:03 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
genius
Level: Trainee

Registered: 22-10-2004
Posts: 3
icon Re: print a whole picture box or form at 600 dpi including the controls over it, is it possible?

quote:
genius wrote:
it doesnt work.
Printer.PrintQuality = 300
Me.PrintForm
i am using a 600 Dpi printer
i have also checked it with other printers. it doestnt work with any one of them.
the result is same pixeletated as without printer.printQualility statement
what shoudl i do   
isnt there any way for me to print at 300 or 600 dpi
plz solve my problem

hey i need a solution plzzzzzzzzzzzzzzzz
Thanks in advance

____________________________
Ask me any thing provided that i can ask you as well because nearly no one is perfect in this world.
27-10-2004 at 04:17 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: print a whole picture box or form at 600 dpi including the controls over it, is it possible?

Ah - I thought you were trying to Print using the Printer Object.
It is not possible to change the print quality when using the PrintForm Method. This method is designed mainly for simple text printing and uses the dpi of the screen, which is usually a heck of a lot less than 300 which is why you get such poor graphics quality.
To get a graphic to print at a decent quality you must use the "PaintPicture" method of the "Printer" Object.
The following code will get the graphics from a PictureBox control, reduce it(if necessary) so that it is no more than 80% of the page width and no more than the height of 10 lines of text, and then Print it centralised on the page.

Dim intPageWidth As Integer, intLineHeight As Integer, intStartPos As Integer
Dim sinPicWidth As Single, sinPicHeight As Single, sinReduce As Single


intPageWidth = Printer.ScaleWidth
intLineHeight = Printer.TextHeight("X")
sinPicWidth = Me.PictureBox1.Picture.Width
sinPicHeight = Me.PictureBox1.Picture.Height
sinReduce = 0.8
Do Until sinPicWidth < (intPageWidth * 0.8) And sinPicHeight < (intLineHeight * 10.01)
sinPicWidth = sinPicWidth * sinReduce
sinPicHeight = sinPicHeight * sinReduce
sinReduce = sinReduce - 0.05
Loop

intStartPos = CInt((intPageWidth - sinPicWidth) / 2)

Printer.PaintPicture Me.PictureBox1.Picture, intStartPos, Printer.CurrentY, sinPicWidth, sinPicHeight
Printer.EndDoc



____________________________
multi-tasking - the ability to hang more than one app. at the same time.

27-10-2004 at 08:33 AM
View Profile Send Email to User Show All Posts | Quote Reply
mikewut
Level: Guest

icon Re: print a whole picture box or form at 600 dpi including the controls over it, is it possible?

i have the same problem... even though you use the printer.paintpicture ... the picture isn't really that great still .. i'm a beginner at VB so I don't know how exactly the printer.painpicture works .. mayb there is another way, by a module maybe?, where the picture is put in the printer object with more serious resolution/dpi so the picture can look a little better...

04-11-2004 at 11:28 AM
| Quote Reply
AndreaVB Forum : Printing : print a whole picture box or form at 600 dpi including the controls over it, is it possible?
Previous Topic (i have problems with print margins)Next Topic (Printing the pictureBox) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder