Link to home
Start Free TrialLog in
Avatar of MICS
MICS

asked on

Printing

Hello, does anyone know how to do high quality printing in VB.

thanks
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Buy good DPI printer? .. It's depends on the device to print.
Avatar of MICS
MICS

ASKER

I have a high quality Laser printer, if i use a program like 3D Studio Max or Photoshop I get high quality, but in VB how do I get it to print in HQ?
Are you having a printing problem now?  How are you printing from VB?

VB can implement high-quality printing by simply opening a print job, sending the required things, then ending the document.

However, if you're trying to print scaled bitmaps, you will likely not get the results you're seeking without some special coding.
Avatar of MICS

ASKER

I tried using the printer object and setting the quality property to vbPRPQHIGH but it doesn't come out nice.   I think the problem is I have an image at lets say 150 DPI , but the printer object has a page res of 72 DPI...    
Yes, VB does not deal with images very well.

How are you getting and saving the image in VB?

Maybe the problem is not specifically VB but the fact that VB converts all images into bitmap format before processing them, and it may lose information along the way like from .jpg/24-bit to screen/8-bit.
Avatar of MICS

ASKER

the image is a BMP.

is use the code to do it.

page.PaintPicture LoadPicture(App.Path + "\Header.bmp"), 0.25, 0.25

where page is a printer object.
Avatar of MICS

ASKER

the image is a BMP.

is use the code to do it.

page.PaintPicture LoadPicture(App.Path + "\Header.bmp"), 0.25, 0.25

where page is a printer object.
Hmm..seems okay.
Probably what's happening is that the printer object is not optimally defined.

Check the settings (printer object properties) to ensure that it uses the best choices. For example, check ColorMode, DrawMode, DriverName, Duplex, etc., and especially PrintQuality.  Use the on-line help to see the various values.

I suspect that the other applications are sending special commands to the printer to optimize it for pictures; when you use the default settings from VB, you are probably optimized for text.
Avatar of MICS

ASKER

Thanks, I will take a look in the next couple days and get back to you.

ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> You cannot delete a question with comments, special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process for further information, if needed.  https://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.  Anytime you have questions which are LOCKED with a Proposed Answer but does not serve your needs, please reject it and add comments as to why.  In addition, when you do grade the question, if the grade is less than an A, please add a comment as to why.  This helps all involved, as well as future persons who may access this item in the future to seek help.

To view your open questions, please click the following link(s) and keep them all current with updates.
https://www.experts-exchange.com/questions/Q.20156134.html
https://www.experts-exchange.com/questions/Q.20240640.html
https://www.experts-exchange.com/questions/Q.20249717.html
https://www.experts-exchange.com/questions/Q.20261587.html
https://www.experts-exchange.com/questions/Q.20279360.html




PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.  Also, if you are interested in the cleanup effort, please click this link https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643

Moderators will finalize this question if still open in 7 days, by either moving this to the PAQ (Previously Asked Questions) at zero points, deleting it or awarding expert(s) when recommendations are made, or an independent determination can be made.  Expert input is always appreciated to determine the fair outcome.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange
Avatar of MICS

ASKER

no solution found.
If you take an image, load it into a picurebox with AutoSize=true, then print the image, how does it look?  What type of file (bmp, gif, jpg, wmf, etc.)?

If you take the same image and print it from another app, how does it look?  What app?
Avatar of MICS

ASKER

if i print through Photoshop it good quality. its just a bmp.
In Photoshop, what size does it say the bitmap is?
Describe the difference in quality.
What is your screen resolution and color depth?  (maybe 256-color?)

Try loading a new VB project and from the form's picture property, locate the same bitmap and load it directly onto the form.  Also add this code:

Private sub Form_Click()
  me.printform
end sub

Run the test app and check the picture to ensure that it looks the way it should.  Click once anywhere in the form and the picture should print.
Has this helped you, MICS?  PLEASE REMAIN ACTIVE IN YOUR QUESTIONS and provide ongoing feedback to the experts who help you.
Thanks,
Moondancer - EE Moderator
Avatar of MICS

ASKER

it hasn't been solved, it doesn't look likr it can be solved without 3rd  party software. I will be removing the question unless anyone can has any other suggestions.  Thanks,
q
Well, I didn't get answers to my previous questions.

Is the screen palette 8-bit or 24-bit?
Is the picture palette 8-bit or 24-bit?

If you take a 24-bit picture into VB with an 8-bit screen and print the picture, it will still print 24-bit color.  However, if you manipulate it in 8-bit, you will get 8-bit output.  To overcome that, you'll need to bump up the palette (internally or externally) before printing.

Avatar of MICS

ASKER

The image is black and white, I dont load it into a form its put direct into a printer object page.
Hmmm.OK.

Black and white images are only 1-bit, so I assume you mean grayscale which, as far as I know, is never more than 8-bit.

Since you're probably not running in 4-bit color Windows, there's no reason that these should differ.  Specifically, I just ran some tests and all looked good:

Test #1:
Load picture into a picture box and print from the picturebox.

Test #2:
Load picture from a file and send directly to the printer

Test #3:
Load picture into Paint Shop Pro (PSP) and print from this app.

The only difference is that PSP centered on the page; otherwise the pictures looked to be of identically decent resolution.

What type of printer are you using?  Maybe the paint programs are bypassing the Windows drivers for that printer and using an improved driver?
Avatar of MICS

ASKER

I will try those tests this week and let you know.

I have used different printers some canon BJC series printers and some Lexmark Ink-Jet and Laser printers
Avatar of MICS

ASKER

ok, VB still print low quality.  and from what i have read elsewhere it can not be improved with out a 3rd party OCX.


Avatar of MICS

ASKER

i will have to put up with the lower quality.

thanks for everyones help in trying to solve it.
Avatar of MICS

ASKER

see prev. msg
You have pended this question for deletion, which is not fair for the experts who have spent their time telling you what you know now to be true.

Please award the expert or experts for their help here rather than attempting to delete it.

If you need my time to help you split points, I'm happy to do it.

Expert input awaited.

Moondancer - EE Moderator
P.S.  If the source file is low quality, so is the printout results... bitmaps are clearly defined here for you.
Avatar of MICS

ASKER

the image file is High quality and the output with VB is LOW quality, if someone wants to send me a a program otherwise i would apreciate it. i use a printer object for printing. If i was to make the document in MS Word it comes out in a much better quality of picture.   i would love to assign points to the correct person. but the comments just dont working for me.
Avatar of MICS

ASKER

my email is dave@mics.ca if someone has a program and the pictures they used to test I will try it out if it works i will award the point and try to fix my program.
Avatar of MICS

ASKER

rspahitz, Moondancer  I dont mind giving the points if its not solved. I just didn't think i should give points if there was no solution...   So if you rspahitz can post a msg saying. "No solution"  i will accept it and give you the point. Also how should i rate it, i dont want to penalize rspahitz for it. so should i just give a 'A' grading?

thanks.
I don't want to get points if the solutions didn't work; I simply don't understand why it doesn't work since I've done it here without problems.

How about we start with something known and work from there:

Open a new VB project.
Go to www.dogopoly.com and find the picture of the dog.
Right-click the dog and copy the picture.
On the VB form, paste the picture.
Add this code behind the form:

Private Sub Form_Click()
  Printer.PaintPicture Form1.Picture, 0, 0
  Printer.EndDoc
End Sub

When you rnu this, the dog should appear.  If you click on the form, it should print.
My printout on an HP LaserJet 4 looks pretty good.

Try pasting this in other applications and see if the quality changes.

Let me know what you find; maybe the picture you're using is not very good quality and Photoshop is digitally enhancing the picture to make it look better.
Avatar of MICS

ASKER

ok...   so they dont seem to have much of a difference...   I think its because I was using stretching in vb...  

does that sound like it could be a problem?
ASKER CERTIFIED SOLUTION
Avatar of rspahitz
rspahitz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MICS

ASKER

ok..  well for your time and effort I will give you the point...  

since I make the image, i can make a high quality larger image.

sorry about that, i didn't realize i was stretching it...

Avatar of MICS

ASKER

here is a bonus...

150 instead of just 100.


Well, thanks.

At least we got down to the root of the problem.