Graphic formats and quality (only for experts)

I am using a .jpg file and a .bmp file in two different picture boxes. I am printing the pictures using the printer object in visual basic (through paintpicture property). I want to know is there any different in quality between the two file formats.

i.e. how does VB represet the graphic file to the printer.Does VB recognizes the difference between the two format I used in picture boxes and sends it as separate information to the printer.

Please give me more details about how to control the priter object more accurately to find the difference between the two printers. Or is there any advance method in VB like using API to send the graphic file to the printer.
Who is Participating?
Actually, similar questions to this have come up several times.  The answer always seems to lead to one thing:  VB prints the picture that is has in memory; Photoshop and other tools seem to manipulate the picture to try to optimize it for the printer.  This interpolation process usually does a good job of making a picture appear nicer than it really is.

In VB, if you load a picture, full-size, into a picturebox, then print it to a printer, full-size, you will get an exact printout of the picture.  The only problem is that what you see on the screen may not really be the actual picture because VB normally displays things in twips rather than pixels, and if your monitor is not configured to exactly handle the image, Windows will do some image manipulation to try to figure out how to tell the monitor to display the image.

That is, if you have an image that is one pixel by one pixel, you will not necessarily see one pixel on the monitor.  That's because Windows interprets this pixel as twips (with 20 twips per point/1440 twips per inch, and normally either 15 or 20 pixels per inch depending on your font-size settings.)  With this translation process, the pixel image may actually show up as several monitor pixels.  This allows the screen picture to appear nice, but when you print it the result may appear slightly different.

Aside from that, you also get the issue of light sources.  Monitors use the additive process of light, which makes green plus blue plus red mix to make white.  Printouts use the subtractive process of light, which makes green plus cyan plus magenta mix to make black.  This results in some possible translation issues when going from a colored screen pixels to a printed pixel.

At this point, I don't know if any of the above helps, so I'll stop rambling on.
The only difference between a .bmp and a .jpg is that they are stored in different formats.  Once loaded into VB, they are no longer .bmps or .jpgs; they are picture objects.

When you print, you are printing a picture object not a bmp or a jpg.  This is also one reason why when you save a picture it always puts it in .bmp format.

When you resize the container which has the picture, VB goes back to the picture object and uses that to display more of the picture if necessary.

If the picture is in an image control, and the Stretch property is true, the picture is retained in its picture object, and the picture is displayed stretched through a separate calculation.  If restretched, it again goes to the picture object to calculate how to resize the image.

So, as rspahitz is saying, once the picture is in the picturebox, it makes no difference what the initial format was.  However, the initial format of the picture may have caused a loss of quality before it was even loaded into VB.

So, if you had a high resolution scanned image and you converted it into a 24-bit bmp and also into a mid to low quality jpg, the jpg would be a substantially smaller file, because of the jpg compression performed.  This compression can lose a significant amount of graphic data, such that if you were to load two VB picture boxes, one from the saved 24-bit bmp and one from the saved jpg, the picturebox with the jpg image loaded into it would not have a high quality image as the one loaded from the .bmp, and would print with lower quality.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

tppradeep18Author Commented:
both of you have given nice information. thanks for that. I want to know whey both images look similar on the screen and once printed look very different. Also want to know, to print the graphics is there any other method other than using printer object. I am really concerned about the quality again. if you guys know any activex control that can print TIFF image please do let me know. I suppose TIFF images have higher quality.
My guess on the difference in quality while printing has to do with the DPI resolution of the image.  You might think that the visual display would be equal in resolution to the DPI but it is not.  You can have two images with very different print quality that appear the same on the screen, because the screen is actually much lower resolution than the printer.

TIFF format tends to be much higher quality because no compression is performed on the image, therefore no graphical data is lost.  However, the files tend to be very large.

There are a ton of graphical OCXs on the market, but I don't know of one specific one to recommend.

There is a replacement for the VB Printer object called VSView from ComponentOne ( formerly called VideoSoft.  The VSView control allows you to format reports which can include pictures, graphics (lines, circles etc), text.  It lets you rotate fonts, add colors, whatever, and then you can print-preview it, and then send to the printer.  I don't know if it would give you any better quality than the VB Printer object, buy you can probably download a Free demo version from the website and try it out.  It's good for a lot of stuff besides, so, it's worth it in my opinion.
Hi tppradeep18,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept rspahitz's comment(s) as an answer.

tppradeep18, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer
per recommendation

Community Support Moderator @Experts Exchange
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.